From f1d68deb060142b7da224209504fcc769d91aaac Mon Sep 17 00:00:00 2001 From: kodjomoustapha <107993382+kodjodevf@users.noreply.github.com> Date: Mon, 9 Dec 2024 14:06:39 +0100 Subject: [PATCH] Torrentio: do not show upcoming episodes --- javascript/anime/src/all/torrentio.js | 6 +++--- javascript/anime/src/all/torrentioanime.js | 6 ++---- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/javascript/anime/src/all/torrentio.js b/javascript/anime/src/all/torrentio.js index 0b2f1742..db8f404f 100644 --- a/javascript/anime/src/all/torrentio.js +++ b/javascript/anime/src/all/torrentio.js @@ -6,7 +6,7 @@ const mangayomiSources = [{ "iconUrl": "https://raw.githubusercontent.com/kodjodevf/mangayomi-extensions/main/javascript/icon/all.torrentio.png", "typeSource": "torrent", "isManga": false, - "version": "0.0.2", + "version": "0.0.25", "appMinVerReq": "0.3.8", "pkgPath": "anime/src/all/torrentio.js" }]; @@ -161,14 +161,14 @@ class DefaultExtension extends MProvider { case "show": const videos = meta.videos || []; return videos + .filter(video => (video.firstAired ? new Date(video.firstAired) : Date.now()) < Date.now()) .map(video => { - const firstAired = video.firstAired ? new Date(video.firstAired) : new Date(); + const firstAired = video.firstAired ? new Date(video.firstAired) : Date.now(); return { url: `/stream/series/${video.id}.json`, dateUpload: firstAired.valueOf().toString(), name: `S${(video.season || "").toString().trim()}:E${(video.number || "").toString()} - ${video.name || ""}`, - scanlator: firstAired > Date.now() ? "Upcoming" : "" }; }) .sort((a, b) => { diff --git a/javascript/anime/src/all/torrentioanime.js b/javascript/anime/src/all/torrentioanime.js index e04777ef..475f7947 100644 --- a/javascript/anime/src/all/torrentioanime.js +++ b/javascript/anime/src/all/torrentioanime.js @@ -6,7 +6,7 @@ const mangayomiSources = [{ "iconUrl": "https://raw.githubusercontent.com/kodjodevf/mangayomi-extensions/main/javascript/icon/all.torrentio.png", "typeSource": "torrent", "isManga": false, - "version": "0.0.15", + "version": "0.0.2", "appMinVerReq": "0.3.8", "pkgPath": "anime/src/all/torrentioanime.js" }]; @@ -247,10 +247,9 @@ class DefaultExtension extends MProvider { case "series": { const videos = episodeList.meta.videos; return videos - .filter(video => video.thumbnail !== null) + .filter(video => video.thumbnail !== null && ((video.released ? new Date(video.released) : Date.now()) < Date.now())) .map(video => { const releaseDate = video.released ? new Date(video.released) : Date.now(); - const upcoming = releaseDate > Date.now() ? "Upcoming" : ""; return { url: `/stream/series/${video.id}.json`, dateUpload: releaseDate.valueOf().toString(), @@ -258,7 +257,6 @@ class DefaultExtension extends MProvider { ?.replace(/^Episode /, "") ?.replace(/^\d+\s*/, "") ?.trim()}`, - scanlator: upcoming, }; }) .reverse();