]> git.ipfire.org Git - thirdparty/tvheadend.git/commitdiff
ui: Fallback to genre mapping if category mapping fails. (#4594)
authorE.Smith <31170571+azlm8t@users.noreply.github.com>
Thu, 23 Nov 2017 14:54:24 +0000 (14:54 +0000)
committerJaroslav Kysela <perex@perex.cz>
Mon, 27 Nov 2017 11:56:32 +0000 (12:56 +0100)
Previously we would map categories or map genres if we had no
categories.

Now we will also map genres if the category mappings fail to generate
any mappings. Current known category mapping always supply 'movie',
'series' or 'sports' so this should not happen.

Issue: #4594.

src/webui/static/app/tvheadend.js

index 4691c31e1453e791f6e0f305dc90495257b69fab..588a898840cc3370936f2e42d122f5fd47ba4add 100644 (file)
@@ -201,7 +201,16 @@ tvheadend.getContentTypeIcons = function(rec) {
       l = catmap_minor[v];
       if (l) ret_minor.push(l)
     }
-  } else {
+  }
+
+  // If we have not mapped any categories, either
+  // due to only having OTA genres or due to categories
+  // not generating any matches, then check the genres.
+  // By default we don't do both category and genre
+  // mappings if we matched any categories since
+  // category mappings are normally more specific
+  // than genres.
+  if (ret_major.length == 0 && ret_minor.length == 0) {
     // Genre code
     var gen = rec.genre;
     if (gen) {