mirror of
https://github.com/Jellify-Music/App.git
synced 2026-05-08 20:39:26 -05:00
[BUG] Track count for playlist is wrong (#686)
Fixes #639, where the track count for playlists would be wrong Co-authored-by: Violet Caulfield <42452695+anultravioletaurora@users.noreply.github.com>
This commit is contained in:
@@ -48,6 +48,7 @@ export async function fetchUserPlaylists(
|
||||
ItemFields.CanDelete,
|
||||
ItemFields.Genres,
|
||||
ItemFields.ChildCount,
|
||||
ItemFields.ItemCounts,
|
||||
],
|
||||
sortBy: [ItemSortBy.SortName],
|
||||
sortOrder: [SortOrder.Ascending],
|
||||
@@ -85,7 +86,13 @@ export async function fetchPublicPlaylists(
|
||||
sortOrder: [SortOrder.Ascending],
|
||||
startIndex: page * QueryConfig.limits.library,
|
||||
limit: QueryConfig.limits.library,
|
||||
fields: ['Path', 'CanDelete', 'Genres'],
|
||||
fields: [
|
||||
ItemFields.Path,
|
||||
ItemFields.CanDelete,
|
||||
ItemFields.Genres,
|
||||
ItemFields.ChildCount,
|
||||
ItemFields.ItemCounts,
|
||||
],
|
||||
})
|
||||
.then((response) => {
|
||||
console.log(response)
|
||||
|
||||
@@ -117,6 +117,9 @@ export default function ItemRow({
|
||||
|
||||
const isAudio = item.Type === 'Audio'
|
||||
|
||||
const playlistTrackCount =
|
||||
item.Type === 'Playlist' ? (item.SongCount ?? item.ChildCount ?? 0) : undefined
|
||||
|
||||
const leftSettings = useSwipeSettingsStore((s) => s.left)
|
||||
const rightSettings = useSwipeSettingsStore((s) => s.right)
|
||||
|
||||
@@ -175,10 +178,10 @@ export default function ItemRow({
|
||||
<XStack justifyContent='flex-end' alignItems='center' flex={2}>
|
||||
{renderRunTime ? (
|
||||
<RunTimeTicks>{item.RunTimeTicks}</RunTimeTicks>
|
||||
) : ['Playlist'].includes(item.Type ?? '') ? (
|
||||
<Text
|
||||
color={'$borderColor'}
|
||||
>{`${item.ChildCount ?? 0} ${item.ChildCount === 1 ? 'Track' : 'Tracks'}`}</Text>
|
||||
) : item.Type === 'Playlist' ? (
|
||||
<Text color={'$borderColor'}>
|
||||
{`${playlistTrackCount ?? 0} ${playlistTrackCount === 1 ? 'Track' : 'Tracks'}`}
|
||||
</Text>
|
||||
) : null}
|
||||
<FavoriteIcon item={item} />
|
||||
|
||||
|
||||
Reference in New Issue
Block a user