mirror of
https://github.com/tapframe/NuvioStreaming.git
synced 2026-01-11 20:10:25 +00:00
fix for trakt only syncing the latest season disregarding the previous seasons
This commit is contained in:
parent
fd1107a5a3
commit
9f3831e733
1 changed files with 25 additions and 2 deletions
|
|
@ -521,9 +521,10 @@ export function useTraktIntegration() {
|
|||
|
||||
try {
|
||||
// Fetch both playback progress and recently watched movies
|
||||
const [traktProgress, watchedMovies] = await Promise.all([
|
||||
const [traktProgress, watchedMovies, watchedShows] = await Promise.all([
|
||||
getTraktPlaybackProgress(),
|
||||
traktService.getWatchedMovies()
|
||||
traktService.getWatchedShows()
|
||||
]);
|
||||
|
||||
// Progress retrieval logging removed
|
||||
|
|
@ -593,6 +594,28 @@ export function useTraktIntegration() {
|
|||
logger.error('[useTraktIntegration] Error preparing watched movie update:', error);
|
||||
}
|
||||
}
|
||||
for (const show of watchedShows) {
|
||||
try {
|
||||
if (show.show?.ids?.imdb && show.seasons) {
|
||||
const showImdbId = show.show.ids.imdb;
|
||||
|
||||
for (const season of show.seasons) {
|
||||
for (const episode of season.episodes) {
|
||||
const episodeId = `${showImdbId}:${season.number}:${episode.number}`;
|
||||
updatePromises.push(
|
||||
storageService.mergeWithTraktProgress(
|
||||
showImdbId,
|
||||
'series',
|
||||
100,
|
||||
episode.last_watched_at,
|
||||
episodeId
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch (error) {
|
||||
logger.error('[useTraktIntegration] Error preparing watched show update:', error);
|
||||
|
||||
// Execute all updates in parallel
|
||||
await Promise.all(updatePromises);
|
||||
|
|
@ -698,4 +721,4 @@ export function useTraktIntegration() {
|
|||
isInWatchlist,
|
||||
isInCollection
|
||||
};
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue