mirror of
https://github.com/movie-web/movie-web.git
synced 2024-12-25 07:11:50 +01:00
Fix progress not restoring correctly
This commit is contained in:
parent
b69c1a4518
commit
2ce42fdb85
@ -31,10 +31,14 @@ export interface BookmarkResponse {
|
||||
|
||||
export interface ProgressResponse {
|
||||
tmdbId: string;
|
||||
seasonId?: string;
|
||||
seasonNumber?: number;
|
||||
episodeNumber?: number;
|
||||
episodeId?: string;
|
||||
season: {
|
||||
id?: string;
|
||||
number?: number;
|
||||
};
|
||||
episode: {
|
||||
id?: string;
|
||||
number?: number;
|
||||
};
|
||||
meta: {
|
||||
title: string;
|
||||
year: number;
|
||||
@ -82,21 +86,21 @@ export function progressResponsesToEntries(responses: ProgressResponse[]) {
|
||||
};
|
||||
}
|
||||
|
||||
if (item.type === "show" && v.seasonId && v.episodeId) {
|
||||
item.seasons[v.seasonId] = {
|
||||
id: v.seasonId,
|
||||
number: v.seasonNumber ?? 0,
|
||||
if (item.type === "show" && v.season.id && v.episode.id) {
|
||||
item.seasons[v.season.id] = {
|
||||
id: v.season.id,
|
||||
number: v.season.number ?? 0,
|
||||
title: "",
|
||||
};
|
||||
item.episodes[v.episodeId] = {
|
||||
id: v.seasonId,
|
||||
number: v.episodeNumber ?? 0,
|
||||
item.episodes[v.episode.id] = {
|
||||
id: v.episode.id,
|
||||
number: v.episode.number ?? 0,
|
||||
title: "",
|
||||
progress: {
|
||||
duration: v.duration,
|
||||
watched: v.watched,
|
||||
},
|
||||
seasonId: v.seasonId,
|
||||
seasonId: v.season.id,
|
||||
updatedAt: new Date(v.updatedAt).getTime(),
|
||||
};
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user