From 476cdf1520c50ac7b27a392701861337bda76137 Mon Sep 17 00:00:00 2001
From: Fernando <fernandog@users.noreply.github.com>
Date: Thu, 10 Dec 2015 13:00:11 -0200
Subject: [PATCH] Fix issue where genre wasn't showing and year and empty year

Seems the empty year is was causing the tag not showing

The only way to show the genre tag is removing "not show.imdbid" - don't know why

But I also can't understand why there's another minor empty tag

Workign show:
![1](https://cloud.githubusercontent.com/assets/2620870/11717754/9c187e4e-9f39-11e5-9514-5afd43cd82b5.png)

Before:
![2](https://cloud.githubusercontent.com/assets/2620870/11717755/9c746fc4-9f39-11e5-89fd-de05679c7cda.png)

After:
![image](https://cloud.githubusercontent.com/assets/2620870/11718585/d0f28764-9f3d-11e5-81a1-855ae0b3a655.png)
---
 gui/slick/views/displayShow.mako | 14 ++++++++------
 1 file changed, 8 insertions(+), 6 deletions(-)

diff --git a/gui/slick/views/displayShow.mako b/gui/slick/views/displayShow.mako
index 9b7515d7f..f53a65488 100644
--- a/gui/slick/views/displayShow.mako
+++ b/gui/slick/views/displayShow.mako
@@ -126,9 +126,12 @@
                 <img src="${srRoot}/images/blank.png" class="country-flag flag-${country}" width="16" height="11" style="margin-left: 3px; vertical-align:middle;" />
         % endfor
     % endif
-    % if 'year' in show.imdb_info:
-                <span>(${show.imdb_info['year']}) - ${show.imdb_info['runtimes']} minutes - </span>
+    <span>
+    % if 'year' in show.imdb_info and show.imdb_info['year']:
+                (${show.imdb_info['year']}) -
     % endif
+                ${show.imdb_info['runtimes']} minutes</span>
+
                 <a href="${anon_url('http://www.imdb.com/title/', _show.imdbid)}" rel="noreferrer" onclick="window.open(this.href, '_blank'); return false;" title="http://www.imdb.com/title/${show.imdbid}"><img alt="[imdb]" height="16" width="16" src="${srRoot}/images/imdb.png" style="margin-top: -1px; vertical-align:middle;"/></a>
 % endif
                 <a href="${anon_url(sickbeard.indexerApi(_show.indexer).config['show_url'], _show.indexerid)}" onclick="window.open(this.href, '_blank'); return false;" title="${sickbeard.indexerApi(show.indexer).config["show_url"] + str(show.indexerid)}"><img alt="${sickbeard.indexerApi(show.indexer).name}" height="16" width="16" src="${srRoot}/images/${sickbeard.indexerApi(show.indexer).config["icon"]}" style="margin-top: -1px; vertical-align:middle;"/></a>
@@ -139,14 +142,13 @@
 
             <div id="tags">
                 <ul class="tags">
-                    % if not show.imdbid and show.genre:
+                    % if ('genres' not in show.imdb_info or not show.imdb_info['genres']) and show.genre:
                         % for genre in show.genre[1:-1].split('|'):
                             <a href="${anon_url('http://trakt.tv/shows/popular/?genres=', genre.lower())}" target="_blank" title="View other popular ${genre} shows on trakt.tv."><li>${genre}</li></a>
                         % endfor
-                    % endif
-                    % if 'year' in show.imdb_info:
+                    % elif 'genres' in show.imdb_info and show.imdb_info['genres']:
                         % for imdbgenre in show.imdb_info['genres'].replace('Sci-Fi','Science-Fiction').split('|'):
-                            <a href="${anon_url('http://trakt.tv/shows/popular/?genres=', imdbgenre.lower())}" target="_blank" title="View other popular ${imdbgenre} shows on trakt.tv."><li>${imdbgenre}</li></a>
+                            <a href="${anon_url('http://www.imdb.com/search/title?count=100&title_type=tv_series&genres=', imdbgenre.lower())}" target="_blank" title="View other popular ${imdbgenre} shows on IMDB."><li>${imdbgenre}</li></a>
                         % endfor
                     % endif
                 </ul>
-- 
GitLab