Improved iframe diff
This commit is contained in:
parent
92c6a7e4b4
commit
273d876758
@ -35,7 +35,9 @@ func GetStatsByUser(ctx *aero.Context) string {
|
|||||||
}
|
}
|
||||||
|
|
||||||
for _, item := range animeList.Items {
|
for _, item := range animeList.Items {
|
||||||
duration := time.Duration(item.Episodes * item.Anime().EpisodeLength)
|
currentWatch := item.Episodes * item.Anime().EpisodeLength
|
||||||
|
reWatch := item.RewatchCount * item.Anime().EpisodeCount * item.Anime().EpisodeLength
|
||||||
|
duration := time.Duration(currentWatch + reWatch)
|
||||||
userStats.AnimeWatchingTime += duration * time.Minute
|
userStats.AnimeWatchingTime += duration * time.Minute
|
||||||
|
|
||||||
ratings[strconv.Itoa(int(item.Rating.Overall+0.5))]++
|
ratings[strconv.Itoa(int(item.Rating.Overall+0.5))]++
|
||||||
|
@ -47,15 +47,19 @@ export class Diff {
|
|||||||
let elemA = a as HTMLElement
|
let elemA = a as HTMLElement
|
||||||
let elemB = b as HTMLElement
|
let elemB = b as HTMLElement
|
||||||
|
|
||||||
// Skip iframes
|
// Ignore lazy images if they have the same source
|
||||||
if(elemA.tagName === "IFRAME") {
|
if(elemA.classList.contains("lazy")) {
|
||||||
|
if(elemA.dataset.src !== elemB.dataset.src) {
|
||||||
|
elemA.dataset.src = elemB.dataset.src
|
||||||
|
elemA.title = elemB.title
|
||||||
|
}
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
// Ignore lazy images if they have the same source
|
// Skip iframes
|
||||||
if(elemA.classList.contains("lazy")) {
|
// This part needs to be executed AFTER lazy images check
|
||||||
elemA.dataset.src = elemB.dataset.src
|
// to allow lazily loaded iframes to update their data src.
|
||||||
elemA.title = elemB.title
|
if(elemA.tagName === "IFRAME") {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user