Просмотр исходного кода

fix emby logo again maybe? again 4

mgomon 7 месяцев назад
Родитель
Сommit
441e19692b
2 измененных файлов с 15 добавлено и 2 удалено
  1. 9 2
      js/custom.js
  2. 6 0
      js/functions.js

+ 9 - 2
js/custom.js

@@ -1432,8 +1432,15 @@ $(document).on("click", ".metadata-get", function(e) {
                         effectiveSource = 'emby';
                     } else if (name.indexOf('jellyfin') !== -1) {
                         effectiveSource = 'jellyfin';
-                    } else {
-                        effectiveSource = source; // fallback
+                    }
+                }
+                // Fallback inference from address if tabName did not resolve
+                if ((effectiveSource === 'jellystat' || effectiveSource === source) && c.address) {
+                    const addr = String(c.address).toLowerCase();
+                    if (addr.indexOf('jellyfin') !== -1) {
+                        effectiveSource = 'jellyfin';
+                    } else if (addr.indexOf('emby') !== -1) {
+                        effectiveSource = 'emby';
                     }
                 }
             }

+ 6 - 0
js/functions.js

@@ -7136,6 +7136,12 @@ function buildMetadata(array, source){
                     if (tn.indexOf('emby') !== -1) { itemSource = 'emby'; }
                     else if (tn.indexOf('jellyfin') !== -1) { itemSource = 'jellyfin'; }
                 }
+                // Fallback inference from address if tabName did not resolve
+                if ((itemSource === source || itemSource === 'jellystat') && v.address) {
+                    var addr = String(v.address).toLowerCase();
+                    if (addr.indexOf('jellyfin') !== -1) { itemSource = 'jellyfin'; }
+                    else if (addr.indexOf('emby') !== -1) { itemSource = 'emby'; }
+                }
             }
         } catch(e) {}
         // Normalize to lowercase to avoid casing issues like 'Emby'