mirror of
https://github.com/sussy-code/smov.git
synced 2024-12-29 16:07:40 +01:00
fix per-scraper progress
This commit is contained in:
parent
de05d66702
commit
c9235906b0
1 changed files with 6 additions and 6 deletions
|
@ -62,22 +62,22 @@ export function MovieView(props) {
|
||||||
let ls = JSON.parse(localStorage.getItem("video-progress") || "{}")
|
let ls = JSON.parse(localStorage.getItem("video-progress") || "{}")
|
||||||
|
|
||||||
// We're just checking lookmovie for now since there is only one scraper
|
// We're just checking lookmovie for now since there is only one scraper
|
||||||
if(!ls.lookmovie) ls.lookmovie = {}
|
if(!ls[streamData.source]) ls[streamData.source] = {}
|
||||||
if(!ls.lookmovie[streamData.type]) ls.lookmovie[streamData.type] = {}
|
if(!ls[streamData.source][streamData.type]) ls[streamData.source][streamData.type] = {}
|
||||||
if(!ls.lookmovie[streamData.type][streamData.slug]) {
|
if(!ls[streamData.source][streamData.type][streamData.slug]) {
|
||||||
ls.lookmovie[streamData.type][streamData.slug] = {}
|
ls[streamData.source][streamData.type][streamData.slug] = {}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Store real data
|
// Store real data
|
||||||
let key = streamData.type === "show" ? `${season}-${episode.episode}` : "full"
|
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),
|
currentlyAt: Math.floor(evt.currentTarget.currentTime),
|
||||||
totalDuration: Math.floor(evt.currentTarget.duration),
|
totalDuration: Math.floor(evt.currentTarget.duration),
|
||||||
updatedAt: Date.now()
|
updatedAt: Date.now()
|
||||||
}
|
}
|
||||||
|
|
||||||
if(streamData.type === "show") {
|
if(streamData.type === "show") {
|
||||||
ls.lookmovie[streamData.type][streamData.slug][key].show = {
|
ls[streamData.source][streamData.type][streamData.slug][key].show = {
|
||||||
season,
|
season,
|
||||||
episode: episode.episode
|
episode: episode.episode
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue