Actualiser mode_affiches.js

This commit is contained in:
Aerya 2025-07-13 07:45:30 +00:00
parent 4e995440fa
commit 2e0c861db1

View File

@ -1,7 +1,7 @@
// ==UserScript==
// @name UseNet Enhanced (Overseerr/Jellyseerr TV Fix + Nouvel Onglet)
// @version 8.4.3
// @date 12.07.25
// @version 8.4.4
// @date 13.07.25
// @description Galerie d'affiches, Radarr/Sonarr/Overseerr/Jellyseerr, badges TMDB/IMDB, options menu stables
// @author Aerya
// @match *://*/*
@ -14,10 +14,31 @@
/* ==================================================================
* 1. AUTOUPDATE DISCRET MULTI-URL
* ==================================================================*/
const LOCAL_VERSION = '8.4.3';
function getLocalVersion() {
try {
let scriptText = document.currentScript?.text || '';
if (!scriptText) {
const scripts = document.querySelectorAll('script');
for (let s of scripts) {
if (s.textContent.includes('@name UseNet Enhanced')) {
scriptText = s.textContent;
break;
}
}
}
const match = scriptText.match(/@version\s+([0-9]+(?:\.[0-9]+)*)/);
return match ? match[1] : null;
} catch {
return null;
}
}
const UPDATE_INTERVAL_MS = 12 * 60 * 60 * 1000;
const UPDATE_LS_KEY = 'afficheLastUpdateCheck';
const LOCAL_VERSION = getLocalVersion() || '0.0.0';
const UPDATE_URLS = [
`${location.protocol}//tig.${location.hostname}/Aerya/Mode-Affiches/raw/branch/main/mode_affiches.js`,
'https://raw.githubusercontent.com/Aerya/Mode-Affiches/main/mode_affiches.js'
@ -64,7 +85,9 @@
}
return 0;
});
window.open(valid[0].url, '_blank');
// Juste prévenir discrètement sans ouvrir donglet
toast(`Nouvelle version dispo : ${valid[0].version} ! Actualise pour mettre à jour.`, 'success', 8000);
});
})();