mirror of
https://github.com/ksyasuda/SubMiner.git
synced 2026-03-20 12:11:28 -07:00
Show anime progress from latest session position
- include anime ID in media detail data - use latest session position for episode progress - update stats UI and lookup tests
This commit is contained in:
@@ -166,9 +166,7 @@ export function App() {
|
||||
? 'Back to Sessions'
|
||||
: 'Back to Library'
|
||||
}
|
||||
onNavigateToAnime={
|
||||
mediaDetail.origin.type === 'anime' ? undefined : navigateToAnime
|
||||
}
|
||||
onNavigateToAnime={navigateToAnime}
|
||||
/>
|
||||
</Suspense>
|
||||
) : (
|
||||
|
||||
@@ -38,7 +38,7 @@ export function MediaDetailView({
|
||||
if (!data?.detail) return <div className="text-ctp-overlay2 p-4">Media not found</div>;
|
||||
|
||||
const sessions = localSessions ?? data.sessions;
|
||||
const animeId = sessions.find((s) => s.animeId != null)?.animeId ?? null;
|
||||
const animeId = data.detail.animeId;
|
||||
const detail = {
|
||||
...data.detail,
|
||||
totalSessions: sessions.length,
|
||||
|
||||
@@ -35,6 +35,7 @@ test('MediaHeader renders Yomitan lookup count and lookup rate copy', () => {
|
||||
detail={{
|
||||
videoId: 7,
|
||||
canonicalTitle: 'Episode 7',
|
||||
animeId: null,
|
||||
totalSessions: 4,
|
||||
totalActiveMs: 90_000,
|
||||
totalCards: 12,
|
||||
@@ -58,6 +59,7 @@ test('MediaHeader distinguishes token occurrences from known unique words', () =
|
||||
detail={{
|
||||
videoId: 7,
|
||||
canonicalTitle: 'Episode 7',
|
||||
animeId: null,
|
||||
totalSessions: 4,
|
||||
totalActiveMs: 90_000,
|
||||
totalCards: 12,
|
||||
|
||||
@@ -136,6 +136,7 @@ export interface MediaDetailData {
|
||||
detail: {
|
||||
videoId: number;
|
||||
canonicalTitle: string;
|
||||
animeId: number | null;
|
||||
totalSessions: number;
|
||||
totalActiveMs: number;
|
||||
totalCards: number;
|
||||
|
||||
Reference in New Issue
Block a user