From 552d3a7c65ff2ee9014504befbfbc90f8e49aa97 Mon Sep 17 00:00:00 2001
From: Admin9705 <9705@duck.com>
Date: Wed, 18 Feb 2026 09:14:02 -0500
Subject: [PATCH] Removed False Page Warnings
---
frontend/static/css/components.css | 4 +
frontend/static/css/import-media.css | 6 +
frontend/static/js/dist/bundle-settings.js | 160 ++++++++++--------
.../features/settings/custom-formats.js | 30 ----
.../modules/features/settings/import-lists.js | 30 ----
.../settings/media-hunt-import-media.js | 100 +++++++++--
frontend/templates/components/scripts.html | 2 +-
.../components/settings_sizes_section.html | 18 +-
8 files changed, 190 insertions(+), 160 deletions(-)
diff --git a/frontend/static/css/components.css b/frontend/static/css/components.css
index ba6825ae..67e5d9b6 100644
--- a/frontend/static/css/components.css
+++ b/frontend/static/css/components.css
@@ -401,6 +401,10 @@
background-color: var(--info-color);
}
+.notification.warning {
+ background: linear-gradient(135deg, #f59e0b, #d97706);
+}
+
/* Placeholder messages */
.placeholder-message {
display: flex;
diff --git a/frontend/static/css/import-media.css b/frontend/static/css/import-media.css
index dc6ad210..a87915bb 100644
--- a/frontend/static/css/import-media.css
+++ b/frontend/static/css/import-media.css
@@ -367,6 +367,12 @@
background: rgba(34, 197, 94, 0.3);
}
+.import-media-btn-confirm:disabled {
+ opacity: 0.5;
+ cursor: not-allowed;
+ pointer-events: none;
+}
+
.import-media-btn-search {
background: rgba(99, 102, 241, 0.15);
color: #a5b4fc;
diff --git a/frontend/static/js/dist/bundle-settings.js b/frontend/static/js/dist/bundle-settings.js
index 6c11fad8..5cbf8412 100644
--- a/frontend/static/js/dist/bundle-settings.js
+++ b/frontend/static/js/dist/bundle-settings.js
@@ -8070,36 +8070,6 @@ document.head.appendChild(styleEl);
if (wrapperEl) wrapperEl.style.display = '';
return;
}
- var indexerCount = (results[4].indexers || []).length;
- if (indexerCount === 0) {
- selectEl.innerHTML = '';
- var emptyOpt = document.createElement('option');
- emptyOpt.value = '';
- emptyOpt.textContent = 'No indexers configured';
- selectEl.appendChild(emptyOpt);
- var noIdxEl = document.getElementById('settings-import-lists-no-indexers');
- var noCliEl = document.getElementById('settings-import-lists-no-clients');
- var wrapperEl = document.getElementById('settings-import-lists-content-wrapper');
- if (noIdxEl) noIdxEl.style.display = '';
- if (noCliEl) noCliEl.style.display = 'none';
- if (wrapperEl) wrapperEl.style.display = 'none';
- return;
- }
- var hasClients = results[5].has_clients === true;
- if (!hasClients) {
- selectEl.innerHTML = '';
- var emptyOpt = document.createElement('option');
- emptyOpt.value = '';
- emptyOpt.textContent = 'No clients configured';
- selectEl.appendChild(emptyOpt);
- var noIdxEl = document.getElementById('settings-import-lists-no-indexers');
- var noCliEl = document.getElementById('settings-import-lists-no-clients');
- var wrapperEl = document.getElementById('settings-import-lists-content-wrapper');
- if (noIdxEl) noIdxEl.style.display = 'none';
- if (noCliEl) noCliEl.style.display = '';
- if (wrapperEl) wrapperEl.style.display = 'none';
- return;
- }
combined.forEach(function(item) {
var opt = document.createElement('option');
opt.value = item.value;
@@ -9167,6 +9137,29 @@ document.head.appendChild(styleEl);
'use strict';
var PREFIX = 'media-hunt-import-media';
+ var IMPORT_MEDIA_PAGE_SIZE = 48;
+
+ function getImportMediaPosterUrl(posterPath, size) {
+ size = size || 'w92';
+ if (!posterPath) return './static/images/blackout.jpg';
+ var fullUrl = (posterPath.indexOf('http') === 0) ? posterPath : ('https://image.tmdb.org/t/p/' + size + (posterPath[0] === '/' ? posterPath : '/' + posterPath));
+ if (window.tmdbImageCache && window.tmdbImageCache.enabled && window.tmdbImageCache.storage === 'server') {
+ return './api/tmdb/image?url=' + encodeURIComponent(fullUrl);
+ }
+ return fullUrl;
+ }
+
+ function applyImportMediaCacheToImages(container) {
+ if (!container || !window.getCachedTMDBImage || !window.tmdbImageCache || !window.tmdbImageCache.enabled || window.tmdbImageCache.storage !== 'browser') return;
+ var imgs = container.querySelectorAll('img[src^="https://image.tmdb.org"]');
+ imgs.forEach(function(img) {
+ var posterUrlVal = img.getAttribute('src');
+ if (!posterUrlVal) return;
+ window.getCachedTMDBImage(posterUrlVal, window.tmdbImageCache).then(function(cachedUrl) {
+ if (cachedUrl && cachedUrl !== posterUrlVal) img.src = cachedUrl;
+ }).catch(function() {});
+ });
+ }
window.MediaHuntImportMedia = {
items: [],
@@ -9174,6 +9167,7 @@ document.head.appendChild(styleEl);
pollInterval: null,
currentSearchFolderPath: null,
importProgressAbort: false,
+ _importScrollObserver: null,
getApiBase: function() {
return this.mode === 'tv' ? './api/tv-hunt' : './api/movie-hunt';
@@ -9242,7 +9236,7 @@ document.head.appendChild(styleEl);
confEl.className = 'import-progress-current-confidence ' + (score >= 70 ? 'high' : score >= 40 ? 'medium' : 'low');
}
if (posterEl) {
- var posterUrl = (currentItem.best_match && currentItem.best_match.poster_path) ? 'https://image.tmdb.org/t/p/w92' + currentItem.best_match.poster_path : './static/images/blackout.jpg';
+ var posterUrl = (currentItem.best_match && currentItem.best_match.poster_path) ? getImportMediaPosterUrl(currentItem.best_match.poster_path, 'w92') : './static/images/blackout.jpg';
posterEl.innerHTML = '';
}
} else {
@@ -9504,9 +9498,52 @@ document.head.appendChild(styleEl);
}
listEl.innerHTML = '';
- for (var i = 0; i < this.items.length; i++) {
- listEl.appendChild(self.createItemElement(this.items[i]));
+ self._importRenderedCount = 0;
+ self._appendImportMediaBatch(listEl);
+ self._setupImportMediaScrollLoad(listEl);
+ },
+
+ _appendImportMediaBatch: function(listEl) {
+ var self = this;
+ var start = self._importRenderedCount || 0;
+ var end = Math.min(start + IMPORT_MEDIA_PAGE_SIZE, self.items.length);
+ for (var i = start; i < end; i++) {
+ listEl.appendChild(self.createItemElement(self.items[i]));
}
+ self._importRenderedCount = end;
+ applyImportMediaCacheToImages(listEl);
+ },
+
+ _setupImportMediaScrollLoad: function(listEl) {
+ var self = this;
+ if (self._importScrollObserver) {
+ self._importScrollObserver.disconnect();
+ self._importScrollObserver = null;
+ }
+ if (self._importRenderedCount >= self.items.length) return;
+
+ var sentinel = document.createElement('div');
+ sentinel.className = 'import-media-scroll-sentinel';
+ sentinel.setAttribute('aria-hidden', 'true');
+ sentinel.style.cssText = 'height:1px;visibility:hidden;pointer-events:none;';
+ listEl.appendChild(sentinel);
+
+ self._importScrollObserver = new IntersectionObserver(function(entries) {
+ if (!entries[0] || !entries[0].isIntersecting) return;
+ if (self._importRenderedCount >= self.items.length) return;
+ self._importScrollObserver.disconnect();
+ sentinel.remove();
+ self._appendImportMediaBatch(listEl);
+ if (self._importRenderedCount < self.items.length) {
+ var newSentinel = document.createElement('div');
+ newSentinel.className = 'import-media-scroll-sentinel';
+ newSentinel.setAttribute('aria-hidden', 'true');
+ newSentinel.style.cssText = 'height:1px;visibility:hidden;pointer-events:none;';
+ listEl.appendChild(newSentinel);
+ self._importScrollObserver.observe(newSentinel);
+ }
+ }, { root: null, rootMargin: '200px', threshold: 0 });
+ self._importScrollObserver.observe(sentinel);
},
createItemElement: function(item) {
@@ -9520,7 +9557,7 @@ document.head.appendChild(styleEl);
if (item.status === 'matched' && item.best_match) {
var m = item.best_match;
- if (m.poster_path) posterUrl = 'https://image.tmdb.org/t/p/w92' + m.poster_path;
+ if (m.poster_path) posterUrl = getImportMediaPosterUrl(m.poster_path, 'w92');
var scoreClass = m.score >= 70 ? 'high' : (m.score >= 40 ? 'medium' : 'low');
matchHtml = '