From b1ba6f8a572009a480de6c6b05a10e8857e2a3bf Mon Sep 17 00:00:00 2001 From: "E.Smith" <31170571+azlm8t@users.noreply.github.com> Date: Thu, 23 Nov 2017 14:54:24 +0000 Subject: [PATCH] ui: Fallback to genre mapping if category mapping fails. (#4594) 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 | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/webui/static/app/tvheadend.js b/src/webui/static/app/tvheadend.js index 4691c31e1..588a89884 100644 --- a/src/webui/static/app/tvheadend.js +++ b/src/webui/static/app/tvheadend.js @@ -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) { -- 2.47.3