mirror of
https://github.com/SickGear/SickGear.git
synced 2025-01-07 10:33:38 +00:00
Add support for country network image files to the Show List view.
This commit is contained in:
parent
edd3e90482
commit
cab3b43903
4 changed files with 26 additions and 20 deletions
|
@ -28,6 +28,7 @@
|
||||||
* Add custom show lists to home page
|
* Add custom show lists to home page
|
||||||
* Change travis to new container builds for faster unit testing
|
* Change travis to new container builds for faster unit testing
|
||||||
* Add handling for shows that do not have a total number of episodes
|
* 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
|
* Change values used for date sorting on home page and episode view for improved compatibility with posix systems
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1726,7 +1726,7 @@ h2.day, h2.network{
|
||||||
float:left;
|
float:left;
|
||||||
line-height:1.4em;
|
line-height:1.4em;
|
||||||
font-size:1.4em;
|
font-size:1.4em;
|
||||||
text-shadow:-1px -1px 0 #FFF)
|
text-shadow:-1px -1px 0 #FFF
|
||||||
}
|
}
|
||||||
|
|
||||||
.tvshowTitleIcons{
|
.tvshowTitleIcons{
|
||||||
|
|
|
@ -357,15 +357,12 @@ $myShowList.sort(lambda x, y: cmp(x.name, y.name))
|
||||||
</td>
|
</td>
|
||||||
|
|
||||||
<td class="show-table">
|
<td class="show-table">
|
||||||
#if $layout != 'simple':
|
#if 'simple' != $layout:
|
||||||
#if $curShow.network:
|
#set $img_text = ($curShow.network, 'No Network')[None is $curShow.network]
|
||||||
<img class="show-network-image" src="$sbRoot/images/network/${curShow.network.replace(u"\u00C9",'e').lower()}.png" alt="$curShow.network" title="$curShow.network" />
|
<img class="show-network-image" src="$sbRoot/images/network/$network_images[$curShow.indexerid]" alt="#echo '%s" title="%s' % ($img_text, $img_text)#" />
|
||||||
#else:
|
#else:
|
||||||
<img class="show-network-image" src="$sbRoot/images/network/nonetwork.png" alt="No Network" title="No Network" />
|
$curShow.network
|
||||||
#end if
|
#end if
|
||||||
#else:
|
|
||||||
$curShow.network
|
|
||||||
#end if
|
|
||||||
</td>
|
</td>
|
||||||
|
|
||||||
<td class="show-table">
|
<td class="show-table">
|
||||||
|
@ -513,14 +510,11 @@ $myShowList.sort(lambda x, y: cmp(x.name, y.name))
|
||||||
<td class="tvShow"><a href="$sbRoot/home/displayShow?show=$curShow.indexerid">$curShow.name</a></td>
|
<td class="tvShow"><a href="$sbRoot/home/displayShow?show=$curShow.indexerid">$curShow.name</a></td>
|
||||||
#end if
|
#end if
|
||||||
|
|
||||||
#if $layout != 'simple':
|
#if 'simple' != $layout:
|
||||||
|
#set $img_text = ($curShow.network, 'No Network')[None is $curShow.network]
|
||||||
<td align="center">
|
<td align="center">
|
||||||
#if $curShow.network:
|
|
||||||
<span style="display: none;">$curShow.network</span>
|
<span style="display: none;">$curShow.network</span>
|
||||||
<img id="network" width="54" height="27" src="$sbRoot/images/network/${curShow.network.replace(u"\u00C9",'e').lower()}.png" alt="$curShow.network" title="$curShow.network" />
|
<img width="54" height="27" src="$sbRoot/images/network/$network_images[$curShow.indexerid]" alt="#echo '%s" title="%s' % ($img_text, $img_text)#" />
|
||||||
#else:
|
|
||||||
<img id="network" width="54" height="27" src="$sbRoot/images/network/nonetwork.png" alt="No Network" title="No Network" />
|
|
||||||
#end if
|
|
||||||
</td>
|
</td>
|
||||||
#else:
|
#else:
|
||||||
<td>
|
<td>
|
||||||
|
|
|
@ -497,10 +497,6 @@ class MainHandler(WebHandler):
|
||||||
else:
|
else:
|
||||||
t.layout = sickbeard.EPISODE_VIEW_LAYOUT
|
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()
|
return t.respond()
|
||||||
|
|
||||||
def _genericMessage(self, subject, message):
|
def _genericMessage(self, subject, message):
|
||||||
|
@ -596,6 +592,21 @@ class Home(MainHandler):
|
||||||
else:
|
else:
|
||||||
t.showlists.append(['container%s' % index, 'Show List', sickbeard.showList])
|
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.submenu = self.HomeMenu()
|
||||||
t.layout = sickbeard.HOME_LAYOUT
|
t.layout = sickbeard.HOME_LAYOUT
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue