Skip to content

Commit

Permalink
Shorten Unknown and BluRay.
Browse files Browse the repository at this point in the history
  • Loading branch information
ElementalCrisis committed Oct 30, 2023
1 parent 4680223 commit b71751e
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions src/components/Collection/ListViewItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand All @@ -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(' | ');
};

Expand Down Expand Up @@ -213,7 +218,7 @@ const ListViewItem = ({ isSeries, isSidebarOpen, item, mainSeries }: Props) => {
<span>EP:</span>
{formatThousand(item.Sizes.Watched.Episodes)}
<span>/</span>
{formatThousand(item.Sizes.Total.Episodes)}
{formatThousand(item.Sizes.Local.Episodes)}
</div>
{item.Sizes.Total.Specials !== 0 && (
<>
Expand All @@ -222,7 +227,7 @@ const ListViewItem = ({ isSeries, isSidebarOpen, item, mainSeries }: Props) => {
<span>SP:</span>
{formatThousand(item.Sizes.Watched.Specials)}
<span>/</span>
{formatThousand(item.Sizes.Total.Specials)}
{formatThousand(item.Sizes.Local.Specials)}
</div>
</>
)}
Expand Down

0 comments on commit b71751e

Please sign in to comment.