diff --git a/CHANGES.md b/CHANGES.md index 7862fa61..73bf8d21 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -28,6 +28,7 @@ * Add custom show lists to home page * Change travis to new container builds for faster unit testing * Add handling for shows that do not have a total number of episodes +* Add support for country network image files to the Show List view * Change values used for date sorting on home page and episode view for improved compatibility with posix systems diff --git a/gui/slick/css/style.css b/gui/slick/css/style.css index a8ab14f1..55384396 100644 --- a/gui/slick/css/style.css +++ b/gui/slick/css/style.css @@ -1726,7 +1726,7 @@ h2.day, h2.network{ float:left; line-height:1.4em; font-size:1.4em; - text-shadow:-1px -1px 0 #FFF) + text-shadow:-1px -1px 0 #FFF } .tvshowTitleIcons{ diff --git a/gui/slick/interfaces/default/home.tmpl b/gui/slick/interfaces/default/home.tmpl index 362341b0..ee6c0963 100644 --- a/gui/slick/interfaces/default/home.tmpl +++ b/gui/slick/interfaces/default/home.tmpl @@ -357,15 +357,12 @@ $myShowList.sort(lambda x, y: cmp(x.name, y.name)) - #if $layout != 'simple': - #if $curShow.network: - $curShow.network - #else: - No Network - #end if - #else: - $curShow.network - #end if +#if 'simple' != $layout: + #set $img_text = ($curShow.network, 'No Network')[None is $curShow.network] + #echo '%s +#else: + $curShow.network +#end if @@ -513,14 +510,11 @@ $myShowList.sort(lambda x, y: cmp(x.name, y.name)) $curShow.name #end if - #if $layout != 'simple': + #if 'simple' != $layout: + #set $img_text = ($curShow.network, 'No Network')[None is $curShow.network] - #if $curShow.network: $curShow.network - $curShow.network - #else: - No Network - #end if + #echo '%s #else: diff --git a/sickbeard/webserve.py b/sickbeard/webserve.py index f9043400..7a0cce06 100644 --- a/sickbeard/webserve.py +++ b/sickbeard/webserve.py @@ -497,10 +497,6 @@ class MainHandler(WebHandler): else: t.layout = sickbeard.EPISODE_VIEW_LAYOUT - # network countries - cache_db = db.DBConnection('cache.db') - t.country_results = ['(%s)' % x['tvrage_country'] for x in cache_db.select('SELECT distinct(tvrage_country) FROM [network_conversions] where tvdb_network like "%(" || tvrage_country || ")" order by tvrage_country')] - return t.respond() def _genericMessage(self, subject, message): @@ -596,6 +592,21 @@ class Home(MainHandler): else: t.showlists.append(['container%s' % index, 'Show List', sickbeard.showList]) + if 'simple' != sickbeard.HOME_LAYOUT: + t.network_images = {} + networks = {} + images_path = ek.ek(os.path.join, sickbeard.PROG_DIR, 'gui', 'slick', 'images', 'network') + for item in sickbeard.showList: + network_name = 'nonetwork' if None is item.network else item.network.replace(u'\u00C9', 'e').lower() + if network_name not in networks: + filename = u'%s.png' % network_name + if not ek.ek(os.path.isfile, ek.ek(os.path.join, images_path, filename)): + filename = u'%s.png' % re.sub(r'(?m)(.*)\s+\(\w{2}\)$', r'\1', network_name) + if not ek.ek(os.path.isfile, ek.ek(os.path.join, images_path, filename)): + filename = u'nonetwork.png' + networks.setdefault(network_name, filename) + t.network_images.setdefault(item.indexerid, networks[network_name]) + t.submenu = self.HomeMenu() t.layout = sickbeard.HOME_LAYOUT