mirror of
https://github.com/jellyfin/jellyfin-web.git
synced 2024-11-16 02:18:16 -07:00
Show "99+" in unplayed indicator when more 100 or more new items
This commit is contained in:
parent
b1add6f48d
commit
10198f9056
@ -78,7 +78,7 @@ export function getPlayedIndicatorHtml(item) {
|
||||
if (enablePlayedIndicator(item)) {
|
||||
const userData = item.UserData || {};
|
||||
if (userData.UnplayedItemCount) {
|
||||
return '<div class="countIndicator indicator">' + datetime.toLocaleString(userData.UnplayedItemCount) + '</div>';
|
||||
return '<div class="countIndicator indicator">' + formatCountIndicator(userData.UnplayedItemCount) + '</div>';
|
||||
}
|
||||
|
||||
if (userData.PlayedPercentage && userData.PlayedPercentage >= 100 || (userData.Played)) {
|
||||
@ -93,12 +93,16 @@ export function getChildCountIndicatorHtml(item, options) {
|
||||
const minCount = options?.minCount ? options.minCount : 0;
|
||||
|
||||
if (item.ChildCount && item.ChildCount > minCount) {
|
||||
return '<div class="countIndicator indicator">' + datetime.toLocaleString(item.ChildCount) + '</div>';
|
||||
return '<div class="countIndicator indicator">' + formatCountIndicator(item.ChildCount) + '</div>';
|
||||
}
|
||||
|
||||
return '';
|
||||
}
|
||||
|
||||
function formatCountIndicator(count) {
|
||||
return count >= 100 ? '99+' : count.toString();
|
||||
}
|
||||
|
||||
export function getTimerIndicator(item) {
|
||||
let status;
|
||||
|
||||
|
@ -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…
Reference in New Issue
Block a user