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:
parent
b1add6f48d
commit
10198f9056
2 changed files with 12 additions and 4 deletions
|
@ -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>
|
||||
);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue