From b71751ee01d7d43d8de3980797d406f938df697b Mon Sep 17 00:00:00 2001 From: ElementalCrisis <9443295+ElementalCrisis@users.noreply.github.com> Date: Sun, 29 Oct 2023 22:26:14 -0700 Subject: [PATCH] Shorten Unknown and BluRay. --- src/components/Collection/ListViewItem.tsx | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/src/components/Collection/ListViewItem.tsx b/src/components/Collection/ListViewItem.tsx index 1f1b22391..95bc004ad 100644 --- a/src/components/Collection/ListViewItem.tsx +++ b/src/components/Collection/ListViewItem.tsx @@ -12,7 +12,7 @@ import { } from '@mdi/js'; import { Icon } from '@mdi/react'; import cx from 'classnames'; -import { forEach, reduce } from 'lodash'; +import { reduce } from 'lodash'; import BackgroundImagePlaceholderDiv from '@/components/BackgroundImagePlaceholderDiv'; import { listItemSize } from '@/components/Collection/CollectionView'; @@ -30,9 +30,14 @@ import type { WebuiGroupExtra } from '@/core/types/api/webui'; const renderFileSources = (sources: SeriesSizesFileSourcesType): string => { const output: string[] = []; - forEach(sources, (source, type) => { - if (source !== 0) output.push(type); + const typeMap = { Unknown: 'Unk', BluRay: 'BD' }; + + Object.entries(sources).forEach(([type, source]) => { + if (source !== 0) { + output.push(typeMap[type] || type); + } }); + return output.join(' | '); }; @@ -213,7 +218,7 @@ const ListViewItem = ({ isSeries, isSidebarOpen, item, mainSeries }: Props) => { EP: {formatThousand(item.Sizes.Watched.Episodes)} / - {formatThousand(item.Sizes.Total.Episodes)} + {formatThousand(item.Sizes.Local.Episodes)} {item.Sizes.Total.Specials !== 0 && ( <> @@ -222,7 +227,7 @@ const ListViewItem = ({ isSeries, isSidebarOpen, item, mainSeries }: Props) => { SP: {formatThousand(item.Sizes.Watched.Specials)} / - {formatThousand(item.Sizes.Total.Specials)} + {formatThousand(item.Sizes.Local.Specials)} )}