-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
UI(storage): display per-folder storage usage in Paths widget #7326
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
UI(storage): display per-folder storage usage in Paths widget #7326
Conversation
Cloudflare Pages deployment
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ESLint doesn't pass. Please fix all ESLint issues.
| refetchOnWindowFocus: false, | ||
| }); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unexpected trailing comma. @stylistic/comma-dangle
Fix available:
| refetchOnWindowFocus: false, | |
| }); | |
| refetchOnWindowFocus: false | |
| }); |
| const hasFolderSize = typeof folderSize === 'number' && folderSize >= 0; | ||
| const driveTotal = (folder as any)?.DriveTotalBytes ?? (folder as any)?.DriveCapacity; | ||
| const readableFolderSize = hasFolderSize ? getReadableSize(folderSize) : undefined; | ||
| const readableDriveTotal = typeof driveTotal === 'number' && driveTotal >= 0 ? getReadableSize(driveTotal) : undefined; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unexpected any. Specify a different type. @typescript-eslint/no-explicit-any
Suggestion(s) available:
| const folderSize = (folder as any)?.FolderSizeBytes ?? (folder as any)?.SizeBytes ?? (folder as any)?.Size; | |
| const folderSize = (folder as unknown)?.FolderSizeBytes ?? (folder as any)?.SizeBytes ?? (folder as any)?.Size; |
| const folderSize = (folder as any)?.FolderSizeBytes ?? (folder as any)?.SizeBytes ?? (folder as any)?.Size; | |
| const folderSize = (folder as never)?.FolderSizeBytes ?? (folder as any)?.SizeBytes ?? (folder as any)?.Size; |
| const hasFolderSize = typeof folderSize === 'number' && folderSize >= 0; | ||
| const driveTotal = (folder as any)?.DriveTotalBytes ?? (folder as any)?.DriveCapacity; | ||
| const readableFolderSize = hasFolderSize ? getReadableSize(folderSize) : undefined; | ||
| const readableDriveTotal = typeof driveTotal === 'number' && driveTotal >= 0 ? getReadableSize(driveTotal) : undefined; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unexpected any. Specify a different type. @typescript-eslint/no-explicit-any
Suggestion(s) available:
| const folderSize = (folder as any)?.FolderSizeBytes ?? (folder as any)?.SizeBytes ?? (folder as any)?.Size; | |
| const folderSize = (folder as any)?.FolderSizeBytes ?? (folder as unknown)?.SizeBytes ?? (folder as any)?.Size; |
| const folderSize = (folder as any)?.FolderSizeBytes ?? (folder as any)?.SizeBytes ?? (folder as any)?.Size; | |
| const folderSize = (folder as any)?.FolderSizeBytes ?? (folder as never)?.SizeBytes ?? (folder as any)?.Size; |
| const hasFolderSize = typeof folderSize === 'number' && folderSize >= 0; | ||
| const driveTotal = (folder as any)?.DriveTotalBytes ?? (folder as any)?.DriveCapacity; | ||
| const readableFolderSize = hasFolderSize ? getReadableSize(folderSize) : undefined; | ||
| const readableDriveTotal = typeof driveTotal === 'number' && driveTotal >= 0 ? getReadableSize(driveTotal) : undefined; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unexpected any. Specify a different type. @typescript-eslint/no-explicit-any
Suggestion(s) available:
| const folderSize = (folder as any)?.FolderSizeBytes ?? (folder as any)?.SizeBytes ?? (folder as any)?.Size; | |
| const folderSize = (folder as any)?.FolderSizeBytes ?? (folder as any)?.SizeBytes ?? (folder as unknown)?.Size; |
| const folderSize = (folder as any)?.FolderSizeBytes ?? (folder as any)?.SizeBytes ?? (folder as any)?.Size; | |
| const folderSize = (folder as any)?.FolderSizeBytes ?? (folder as any)?.SizeBytes ?? (folder as never)?.Size; |
| const readableFolderSize = hasFolderSize ? getReadableSize(folderSize) : undefined; | ||
| const readableDriveTotal = typeof driveTotal === 'number' && driveTotal >= 0 ? getReadableSize(driveTotal) : undefined; | ||
|
|
||
| return ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unexpected any. Specify a different type. @typescript-eslint/no-explicit-any
Suggestion(s) available:
| const driveTotal = (folder as any)?.DriveTotalBytes ?? (folder as any)?.DriveCapacity; | |
| const driveTotal = (folder as unknown)?.DriveTotalBytes ?? (folder as any)?.DriveCapacity; |
| const driveTotal = (folder as any)?.DriveTotalBytes ?? (folder as any)?.DriveCapacity; | |
| const driveTotal = (folder as never)?.DriveTotalBytes ?? (folder as any)?.DriveCapacity; |
| : (typeof folderTotal === 'number' && folderTotal > 0) ? folderTotal | ||
| : calculateTotal(folder); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
':' should be placed at the end of the line. @stylistic/operator-linebreak
Fix available:
| : (typeof folderTotal === 'number' && folderTotal > 0) ? folderTotal | |
| : calculateTotal(folder); | |
| (typeof folderTotal === 'number' && folderTotal > 0) ? folderTotal | |
| : calculateTotal(folder); |
| const folderTotal = (folder as any)?.FolderSizeBytes ?? (folder as any)?.SizeBytes ?? (folder as any)?.Size; | ||
|
|
||
| const total = (typeof driveTotal === 'number' && driveTotal > 0) ? driveTotal | ||
| : (typeof folderTotal === 'number' && folderTotal > 0) ? folderTotal |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Extract this nested ternary operation into an independent statement. sonarjs/no-nested-conditional
|
|
||
| const total = (typeof driveTotal === 'number' && driveTotal > 0) ? driveTotal | ||
| : (typeof folderTotal === 'number' && folderTotal > 0) ? folderTotal | ||
| : calculateTotal(folder); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Expected indentation of 12 spaces but found 8. @stylistic/indent
Fix available:
| : calculateTotal(folder); | |
| : calculateTotal(folder); |
| : calculateTotal(folder); | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
':' should be placed at the end of the line. @stylistic/operator-linebreak
Fix available:
| : calculateTotal(folder); | |
| calculateTotal(folder); | |
| if (total <= 0) return 0; | ||
|
|
||
| return Math.min(100, (used / total) * 100); | ||
| }; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Newline required at end of file but not found. @stylistic/eol-last
Fix available:
| }; | |
| }; | |



Fixes #7323
Summary
Prefer per-folder
FolderSizeBytesandDriveTotalBytesreturned by the backend when rendering the Dashboard → Paths widget. Only show a progress bar when folder-level sizes exist to avoid misleading identical bars per path.Changes
FolderSizeBytes/DriveTotalBytesinsrc/apps/dashboard/features/storage/utils/space.ts.StorageListItem.tsxonly when per-folder sizes exist.useSystemStorageto confirm API returns the new fields.src/lib/jellyfin-apiclient/*files as needed.Verification
Webfolder onT:\shows its separate drive capacity; other paths onC:\show different totals.Notes
This PR depends on backend changes that provide
FolderSizeBytesandDriveTotalBytesvia the System Storage API. See backend PR:jellyfin/jellyfin#<backend-pr-number>(link when created).