feat: disk stats for library folder (#2560)

This commit is contained in:
Jason Rasmussen
2023-05-24 22:05:31 -04:00
committed by GitHub
parent 7c1dae918d
commit 83df14d379
3 changed files with 18 additions and 11 deletions
@@ -14,10 +14,14 @@ export class StorageCore {
folder: StorageFolder.ENCODED_VIDEO | StorageFolder.UPLOAD | StorageFolder.PROFILE | StorageFolder.THUMBNAILS,
userId: string,
) {
return join(APP_MEDIA_LOCATION, folder, userId);
return join(this.getBaseFolder(folder), userId);
}
getLibraryFolder(user: { storageLabel: string | null; id: string }) {
return join(APP_MEDIA_LOCATION, StorageFolder.LIBRARY, user.storageLabel || user.id);
return join(this.getBaseFolder(StorageFolder.LIBRARY), user.storageLabel || user.id);
}
getBaseFolder(folder: StorageFolder) {
return join(APP_MEDIA_LOCATION, folder);
}
}