1
0
Fork 0
mirror of https://github.com/jellyfin/jellyfin-web synced 2025-03-30 19:56:21 +00:00

Show "99+" in unplayed indicator when more 100 or more new items

This commit is contained in:
Andrew Rabert 2024-05-01 18:03:20 -04:00
parent b1add6f48d
commit 10198f9056
2 changed files with 12 additions and 4 deletions

View file

@ -60,6 +60,10 @@ const enablePlayedIndicator = (item: ItemDto) => {
return itemHelper.canMarkPlayed(item);
};
const formatCountIndicator = (count: number) => {
return count >= 100 ? '99+' : count.toString();
};
const useIndicator = (item: ItemDto) => {
const getMediaSourceIndicator = () => {
const mediaSourceCount = item.MediaSourceCount ?? 0;
@ -135,7 +139,7 @@ const useIndicator = (item: ItemDto) => {
if (childCount > 1) {
return (
<Box className='countIndicator indicator childCountIndicator'>
{datetime.toLocaleString(item.ChildCount)}
{formatCountIndicator(childCount)}
</Box>
);
}
@ -149,7 +153,7 @@ const useIndicator = (item: ItemDto) => {
if (userData.UnplayedItemCount) {
return (
<Box className='countIndicator indicator unplayedItemCount'>
{datetime.toLocaleString(userData.UnplayedItemCount)}
{formatCountIndicator(userData.UnplayedItemCount)}
</Box>
);
}