From c9235906b094662d19163e11b9c29f8b01ccfadf Mon Sep 17 00:00:00 2001 From: James Hawkins Date: Wed, 21 Jul 2021 11:29:18 +0100 Subject: [PATCH] fix per-scraper progress --- src/views/Movie.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/views/Movie.js b/src/views/Movie.js index 4ad94786..795bec25 100644 --- a/src/views/Movie.js +++ b/src/views/Movie.js @@ -62,22 +62,22 @@ export function MovieView(props) { let ls = JSON.parse(localStorage.getItem("video-progress") || "{}") // We're just checking lookmovie for now since there is only one scraper - if(!ls.lookmovie) ls.lookmovie = {} - if(!ls.lookmovie[streamData.type]) ls.lookmovie[streamData.type] = {} - if(!ls.lookmovie[streamData.type][streamData.slug]) { - ls.lookmovie[streamData.type][streamData.slug] = {} + if(!ls[streamData.source]) ls[streamData.source] = {} + if(!ls[streamData.source][streamData.type]) ls[streamData.source][streamData.type] = {} + if(!ls[streamData.source][streamData.type][streamData.slug]) { + ls[streamData.source][streamData.type][streamData.slug] = {} } // Store real data let key = streamData.type === "show" ? `${season}-${episode.episode}` : "full" - ls.lookmovie[streamData.type][streamData.slug][key] = { + ls[streamData.source][streamData.type][streamData.slug][key] = { currentlyAt: Math.floor(evt.currentTarget.currentTime), totalDuration: Math.floor(evt.currentTarget.duration), updatedAt: Date.now() } if(streamData.type === "show") { - ls.lookmovie[streamData.type][streamData.slug][key].show = { + ls[streamData.source][streamData.type][streamData.slug][key].show = { season, episode: episode.episode }