mirror of
https://github.com/tapframe/NuvioStreaming.git
synced 2026-04-21 00:32:04 +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 {
|
try {
|
||||||
// Fetch both playback progress and recently watched movies
|
// Fetch both playback progress and recently watched movies
|
||||||
const [traktProgress, watchedMovies] = await Promise.all([
|
const [traktProgress, watchedMovies, watchedShows] = await Promise.all([
|
||||||
getTraktPlaybackProgress(),
|
getTraktPlaybackProgress(),
|
||||||
traktService.getWatchedMovies()
|
traktService.getWatchedMovies()
|
||||||
|
traktService.getWatchedShows()
|
||||||
]);
|
]);
|
||||||
|
|
||||||
// Progress retrieval logging removed
|
// Progress retrieval logging removed
|
||||||
|
|
@ -593,6 +594,28 @@ export function useTraktIntegration() {
|
||||||
logger.error('[useTraktIntegration] Error preparing watched movie update:', error);
|
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
|
// Execute all updates in parallel
|
||||||
await Promise.all(updatePromises);
|
await Promise.all(updatePromises);
|
||||||
|
|
@ -698,4 +721,4 @@ export function useTraktIntegration() {
|
||||||
isInWatchlist,
|
isInWatchlist,
|
||||||
isInCollection
|
isInCollection
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue