+
+
+
+
+
+ Entire Collection
+
+
+ {group.Size > 1 && (
+ <>
+
+ {group.Name}
+
+
+ >
+ )}
-
-
-
-
- EP:
- {formatThousand(series.Sizes.Local.Episodes)}
- /
- {formatThousand(series.Sizes.Total.Episodes)}
-
- {series.Sizes.Total.Specials !== 0 && (
- <>
-
|
-
- SP:
- {formatThousand(series.Sizes.Local.Specials)}
- /
- {formatThousand(series.Sizes.Total.Specials)}
-
- >
- )}
+
+
+
+
{series.Name}
+
+ Original Title:
+ {series.AniDB?.Titles.find(title => title.Type === 'Main')?.Name}
-
-
-
-
-
- EP:
- {formatThousand(series.Sizes.Watched.Episodes)}
- /
- {formatThousand(series.Sizes.Local.Episodes)}
-
- {series.Sizes.Total.Specials !== 0 && (
- <>
-
|
-
- SP:
- {formatThousand(series.Sizes.Watched.Specials)}
- /
- {formatThousand(series.Sizes.Local.Specials)}
-
- >
- )}
+
+ {tags.slice(0, 13).map(tag => )}
+
+
+
- {(series.Sizes.Total.Episodes - series.Sizes.Local.Episodes !== 0
- || series.Sizes.Total.Specials - series.Sizes.Local.Specials !== 0) && (
-
-
- {series.Sizes.Total.Episodes - series.Sizes.Local.Episodes !== 0 && (
-
-
- EP:
- {formatThousand(series.Sizes.Total.Episodes - series.Sizes.Local.Episodes)}
-
-
- )}
- {series.Sizes.Total.Episodes - series.Sizes.Local.Episodes !== 0 &&
| }
- {series.Sizes.Total.Specials - series.Sizes.Local.Specials !== 0 && (
-
- SP:
- {formatThousand(series.Sizes.Total.Specials - series.Sizes.Local.Specials)}
-
- )}
-
- )}
-
-
- {tags.slice(0, 7).map(tag =>
)}
+
-
-
+
@@ -243,7 +147,7 @@ const Series = () => {
onClick={() => setShowEditSeriesModal(true)}
>
- Edit
+ Edit Series
diff --git a/src/pages/collection/series/SeriesOverview.tsx b/src/pages/collection/series/SeriesOverview.tsx
index 0d40ab926..bdc8231cd 100644
--- a/src/pages/collection/series/SeriesOverview.tsx
+++ b/src/pages/collection/series/SeriesOverview.tsx
@@ -1,20 +1,12 @@
import React, { useMemo } from 'react';
import { useParams } from 'react-router';
import { Link } from 'react-router-dom';
-import {
- mdiChevronRight,
- mdiCloseCircleOutline,
- mdiOpenInNew,
- mdiPencilCircleOutline,
- mdiPlusCircleOutline,
-} from '@mdi/js';
-import { Icon } from '@mdi/react';
import cx from 'classnames';
import { get, round, toNumber } from 'lodash';
import BackgroundImagePlaceholderDiv from '@/components/BackgroundImagePlaceholderDiv';
import EpisodeDetails from '@/components/Collection/Series/EpisodeDetails';
-import Button from '@/components/Input/Button';
+import SeriesMetadata from '@/components/Collection/SeriesMetadata';
import ShokoPanel from '@/components/Panels/ShokoPanel';
import {
useGetAniDBRelatedQuery,
@@ -22,15 +14,10 @@ import {
useGetSeriesQuery,
useNextUpEpisodeQuery,
} from '@/core/rtkQuery/splitV3Api/seriesApi';
-import { useGetSeriesOverviewQuery } from '@/core/rtkQuery/splitV3Api/webuiApi';
-import { dayjs } from '@/core/util';
import useEpisodeThumbnail from '@/hooks/useEpisodeThumbnail';
import type { EpisodeType } from '@/core/types/api/episode';
import type { SeriesAniDBRelatedType, SeriesAniDBSimilarType } from '@/core/types/api/series';
-import type { WebuiSeriesDetailsType } from '@/core/types/api/webui';
-
-const links = ['TMDB', 'TvDB', 'MAL', 'AniList', 'TraktTv'];
const NextUpEpisode = ({ nextUpEpisode }: { nextUpEpisode: EpisodeType }) => {
const thumbnail = useEpisodeThumbnail(nextUpEpisode);
@@ -45,76 +32,11 @@ const NextUpEpisode = ({ nextUpEpisode }: { nextUpEpisode: EpisodeType }) => {
);
};
-const MetadataLink = ({ id, series, site }: { site: string, id: number | number[], series: string }) => {
- const linkId = Array.isArray(id) ? id[0] : id;
-
- const siteLink = useMemo(() => {
- switch (site) {
- case 'TMDB':
- return `https://www.themoviedb.org/movie/${linkId}`;
- case 'TvDB':
- // TODO: Figure how to get tvdb series link using ID
- return '#';
- case 'MAL':
- return `https://myanimelist.net/anime/${linkId}`;
- case 'AniList':
- return `https://anilist.co/anime/${linkId}`;
- case 'TraktTv':
- // TODO: Figure how to get trakt series link using ID
- return '#';
- default:
- return '#';
- }
- }, [linkId, site]);
-
- return (
-
-
-
- {linkId
- ? (
- <>
-
-
-
-
-
-
- >
- )
- : (
-
-
-
- )}
-
-
- );
-};
-
const SeriesOverview = () => {
const { seriesId } = useParams();
const seriesData = useGetSeriesQuery({ seriesId: seriesId!, includeDataFrom: ['AniDB'] }, { skip: !seriesId });
const series = useMemo(() => seriesData?.data, [seriesData]);
- const seriesOverviewData = useGetSeriesOverviewQuery({ SeriesID: seriesId! }, { skip: !seriesId });
- const overview = seriesOverviewData?.data || {} as WebuiSeriesDetailsType;
const nextUpEpisodeData = useNextUpEpisodeQuery({ seriesId: toNumber(seriesId) });
const nextUpEpisode: EpisodeType = nextUpEpisodeData?.data ?? {} as EpisodeType;
const relatedData = useGetAniDBRelatedQuery({ seriesId: seriesId! }, { skip: !seriesId });
@@ -122,132 +44,33 @@ const SeriesOverview = () => {
const similarData = useGetAniDBSimilarQuery({ seriesId: seriesId! }, { skip: !seriesId });
const similar: SeriesAniDBSimilarType[] = similarData?.data ?? [] as SeriesAniDBSimilarType[];
- const jpOfficialSite = useMemo(() => series?.Links.find(link => link.Name === 'Official Site (JP)'), [series]);
- const enOfficialSite = useMemo(() => series?.Links.find(link => link.Name === 'Official Site (EN)'), [series]);
+ // Links
+ const metadataLinks = ['AniDB', 'TMDB', 'TvDB', 'TraktTv'];
if (!seriesId || !series) return null;
return (
<>
-
-
-
Source
- {overview.SourceMaterial}
-
-
-
-
Episodes
-
- {series.Sizes.Total.Episodes}
- Episodes
-
-
- {series.Sizes.Total.Specials}
- Specials
-
-
-
-
-
Length
- {/* TODO: Get episode length */}
-
-- Minutes/Episode
-
-
-
-
Status
- {/* TODO: Check if there are more status types */}
- {(series.AniDB?.EndDate && dayjs(series.AniDB.EndDate).isAfter(dayjs())) ? 'Ongoing' : 'Finished'}
-
-
-
-
Season
- {overview?.FirstAirSeason
- ? (
-
- {overview.FirstAirSeason.Name}
-
- )
- : '--'}
-
-
-
-
Studio
-
{overview?.Studios?.[0] ? overview?.Studios?.[0].Name : 'Studio Not Listed'}
-
-
- {/* */}
- {/*
Producers
*/}
- {/* {overview?.Producers?.map(item =>
{item.Name}
)} */}
- {/*
*/}
-
-
-
Links
- {/* TODO: Only showing links with Official JP and EN sites for now. To be changed */}
- {jpOfficialSite && (
-
- )}
- {enOfficialSite && (
-
- )}
-
-
-
-
-
+
- }
- className="flex grow-0"
+ title="Metadata Sites"
+ className="flex w-full max-w-[42.188rem] grow-0"
transparent
>
-
- {links.map(site => (
+
+ {metadataLinks.map(site => (
-
+
))}