feat: Make Radarr optional and some improvements to optional integrations

This commit is contained in:
Aleksi Lassila
2023-08-15 14:01:43 +03:00
parent 0b7956e6b6
commit 1200489a19
14 changed files with 356 additions and 297 deletions

View File

@@ -21,7 +21,9 @@
);
const diskSpaceInfo =
(await discSpacePromise).find((disk) => disk.path === '/') || (await discSpacePromise)[0];
(await discSpacePromise).find((disk) => disk.path === '/') ||
(await discSpacePromise)[0] ||
undefined;
const spaceOccupied = availableMovies.reduce(
(acc, movie) => acc + (movie.radarrMovie?.sizeOnDisk || 0),
@@ -30,9 +32,9 @@
return {
moviesCount: availableMovies.length,
spaceLeft: diskSpaceInfo.freeSpace || 0,
spaceLeft: diskSpaceInfo?.freeSpace || 0,
spaceOccupied,
spaceTotal: diskSpaceInfo.totalSpace || 0
spaceTotal: diskSpaceInfo?.totalSpace || 0
};
}
</script>