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 {
|
||||
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
|
||||
|
||||
ratings[strconv.Itoa(int(item.Rating.Overall+0.5))]++
|
||||
|
@ -47,15 +47,19 @@ export class Diff {
|
||||
let elemA = a as HTMLElement
|
||||
let elemB = b as HTMLElement
|
||||
|
||||
// Skip iframes
|
||||
if(elemA.tagName === "IFRAME") {
|
||||
// Ignore lazy images if they have the same source
|
||||
if(elemA.classList.contains("lazy")) {
|
||||
if(elemA.dataset.src !== elemB.dataset.src) {
|
||||
elemA.dataset.src = elemB.dataset.src
|
||||
elemA.title = elemB.title
|
||||
}
|
||||
continue
|
||||
}
|
||||
|
||||
// Ignore lazy images if they have the same source
|
||||
if(elemA.classList.contains("lazy")) {
|
||||
elemA.dataset.src = elemB.dataset.src
|
||||
elemA.title = elemB.title
|
||||
// Skip iframes
|
||||
// This part needs to be executed AFTER lazy images check
|
||||
// to allow lazily loaded iframes to update their data src.
|
||||
if(elemA.tagName === "IFRAME") {
|
||||
continue
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user