Skip to content

Commit e0cdc53

Browse files
committed
TV Shows/Anime: Fix for shows with more than 999 episodes showing X... instead of XXXX
bump theme version 0.8.0-beta2.4
1 parent e5e1d3f commit e0cdc53

File tree

9 files changed

+36
-2
lines changed

9 files changed

+36
-2
lines changed

addon.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
22
<addon id="script.plexmod"
33
name="Plex"
4-
version="0.8.0-beta2.2"
4+
version="0.8.0-beta2.4"
55
provider-name="pannal">
66
<requires>
77
<import addon="xbmc.python" version="3.0.0"/>

lib/util.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@
5656

5757

5858
DEF_THEME = "modern-colored"
59-
THEME_VERSION = 24
59+
THEME_VERSION = 26
6060

6161
xbmc.log('script.plex: Kodi {0}.{1} (build {2})'.format(KODI_VERSION_MAJOR, KODI_VERSION_MINOR, KODI_BUILD_NUMBER),
6262
xbmc.LOGINFO)

lib/windows/episodes.py

+2
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ def prepareListItem(self, data, mli):
7373
mli.setBoolProperty('watched', mli.dataSource.isFullyWatched)
7474
if not mli.dataSource.isWatched:
7575
mli.setProperty('unwatched.count', str(mli.dataSource.unViewedLeafCount))
76+
mli.setBoolProperty('unwatched.count.large', mli.dataSource.unViewedLeafCount.asInt() > 999)
7677
mli.setProperty('unwatched', '1')
7778
mli.setProperty('progress', util.getProgressImage(mli.dataSource))
7879

@@ -464,6 +465,7 @@ def selectEpisode(self, from_reinit=False):
464465
mli.setProperty('watched', '1')
465466
mli.setProperty('progress', '')
466467
mli.setProperty('unwatched.count', '')
468+
mli.setProperty('unwatched.count.large', '')
467469
mli.dataSource.set('viewCount', mli.dataSource.get('viewCount', 0).asInt() + 1)
468470
mli.dataSource.set('viewOffset', 0)
469471
self.setUserItemInfo(mli, fully_watched=True)

lib/windows/home.py

+3
Original file line numberDiff line numberDiff line change
@@ -1907,6 +1907,7 @@ def createSeasonListItem(self, obj, wide=False):
19071907
mli.setProperty('thumb.fallback', 'script.plex/thumb_fallbacks/show.png')
19081908
if not obj.isWatched:
19091909
mli.setProperty('unwatched.count', str(obj.unViewedLeafCount))
1910+
mli.setBoolProperty('unwatched.count.large', obj.unViewedLeafCount > 999)
19101911
mli.setBoolProperty('watched', obj.isFullyWatched)
19111912
return mli
19121913

@@ -1923,6 +1924,7 @@ def createShowListItem(self, obj, wide=False):
19231924
mli.setProperty('thumb.fallback', 'script.plex/thumb_fallbacks/show.png')
19241925
if not obj.isWatched:
19251926
mli.setProperty('unwatched.count', str(obj.unViewedLeafCount))
1927+
mli.setBoolProperty('unwatched.count.large', obj.unViewedLeafCount > 999)
19261928
mli.setBoolProperty('watched', obj.isFullyWatched)
19271929
return mli
19281930

@@ -2164,6 +2166,7 @@ def updateListItem(self, mli):
21642166
mli.setProperty('unwatched.count', '')
21652167
else:
21662168
mli.setProperty('unwatched.count', str(obj.unViewedLeafCount))
2169+
mli.setBoolProperty('unwatched.count.large', obj.unViewedLeafCount > 999)
21672170

21682171
def sectionClicked(self):
21692172
item = self.sectionList.getSelectedItem()

lib/windows/library.py

+2
Original file line numberDiff line numberDiff line change
@@ -1015,6 +1015,7 @@ def updateUnwatchedAndProgress(self, mli):
10151015
else:
10161016
if self.section.TYPE == 'show' or mli.dataSource.TYPE == 'show' or mli.dataSource.TYPE == 'season':
10171017
mli.setProperty('unwatched.count', str(mli.dataSource.unViewedLeafCount))
1018+
mli.setBoolProperty('unwatched.count.large', mli.dataSource.unViewedLeafCount.asInt() > 999)
10181019
else:
10191020
mli.setProperty('unwatched', '1')
10201021
mli.setProperty('progress', util.getProgressImage(mli.dataSource))
@@ -1419,6 +1420,7 @@ def _chunkCallback(self, items, start):
14191420
if not obj.isWatched and obj.TYPE != "Directory":
14201421
if self.section.TYPE == 'show' or obj.TYPE == 'show' or obj.TYPE == 'season':
14211422
mli.setProperty('unwatched.count', str(obj.unViewedLeafCount))
1423+
mli.setBoolProperty('unwatched.count.large', obj.unViewedLeafCount > 999)
14221424
else:
14231425
mli.setProperty('unwatched', '1')
14241426
elif obj.isFullyWatched and obj.TYPE != "Directory":

lib/windows/mixins.py

+1
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ def fillSeasons(self, show, update=False, seasonsFilter=None, selectSeason=None,
6868
mli.setProperty('index', str(idx))
6969
mli.setProperty('thumb.fallback', 'script.plex/thumb_fallbacks/show.png')
7070
mli.setProperty('unwatched.count', not season.isWatched and str(season.unViewedLeafCount) or '')
71+
mli.setBoolProperty('unwatched.count.large', not season.isWatched and season.unViewedLeafCount > 999)
7172
mli.setBoolProperty('watched', season.isFullyWatched)
7273
if not season.isWatched and focus is None and season.index.asInt() > 0:
7374
focus = idx

lib/windows/pagination.py

+1
Original file line numberDiff line numberDiff line change
@@ -271,6 +271,7 @@ def prepareListItem(self, data, mli):
271271
if data.type in ('season', 'show'):
272272
if not mli.dataSource.isWatched:
273273
mli.setProperty('unwatched.count', str(mli.dataSource.unViewedLeafCount) or '')
274+
mli.setBoolProperty('unwatched.count.large', mli.dataSource.unViewedLeafCount > 999)
274275
else:
275276
mli.setBoolProperty('watched', mli.dataSource.isWatched)
276277
else:

lib/windows/subitems.py

+1
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,7 @@ def updateProperties(self):
132132
self.setProperty('date', self.mediaItem.year)
133133
if not self.mediaItem.isWatched:
134134
self.setProperty('unwatched.count', str(self.mediaItem.unViewedLeafCount) or '')
135+
self.setBoolProperty('unwatched.count.large', self.mediaItem.unViewedLeafCount > 999)
135136
else:
136137
self.setBoolProperty('watched', self.mediaItem.isWatched)
137138

resources/skins/Main/1080i/templates/includes/watched_indicator.xml.tpl

+24
Original file line numberDiff line numberDiff line change
@@ -56,16 +56,27 @@
5656
</control>
5757
{% else %}
5858
<control type="image">
59+
<visible>String.IsEmpty({{ itemref|default("ListItem") }}.Property(unwatched.count.large))</visible>
5960
<posx>{{ xoff - wbg_w }}</posx>
6061
<posy>{{ yoff|vscale }}</posy>
6162
<width>{{ wbg_w }}</width>
6263
<height>{{ wbg_h|vscale }}</height>
6364
<texture>{{ wbg|default("script.plex/white-square-bl-rounded_w.png") }}</texture>
6465
<colordiffuse>{{ indicators.unwatched_count_bg|default("FFCC7B19") }}</colordiffuse>
6566
</control>
67+
<control type="image">
68+
<visible>!String.IsEmpty({{ itemref|default("ListItem") }}.Property(unwatched.count.large))</visible>
69+
<posx>{{ xoff - wbg_w - 16 }}</posx>
70+
<posy>{{ yoff|vscale }}</posy>
71+
<width>{{ wbg_w + 16 }}</width>
72+
<height>{{ wbg_h|vscale }}</height>
73+
<texture>{{ wbg|default("script.plex/white-square-bl-rounded_w.png") }}</texture>
74+
<colordiffuse>{{ indicators.unwatched_count_bg|default("FFCC7B19") }}</colordiffuse>
75+
</control>
6676
{% endif %}
6777
<control type="label">{# this label uses a nasty hack to get a smaller fitting font size: use a larger font, increase the label size, then zoom it down #}
6878
<animation effect="zoom" start="40" end="40" time="0" reversible="false" center="auto" condition="true">Conditional</animation>
79+
<visible>String.IsEmpty({{ itemref|default("ListItem") }}.Property(unwatched.count.large))</visible>
6980
<posx>{{ xoff - wbg_w - 16 }}</posx>
7081
<posy>{{ (yoff - 8)|vscale }}</posy>
7182
<width>{{ wbg_w + 32 }}</width>
@@ -76,6 +87,19 @@
7687
<textcolor>{{ indicators.textcolor|default("FF000000") }}</textcolor>
7788
<label>$INFO[{{ itemref|default("ListItem") }}.Property(unwatched.count)]</label>
7889
</control>
90+
<control type="label">{# this label uses a nasty hack to get a smaller fitting font size: use a larger font, increase the label size, then zoom it down #}
91+
<animation effect="zoom" start="40" end="40" time="0" reversible="false" center="auto" condition="true">Conditional</animation>
92+
<visible>!String.IsEmpty({{ itemref|default("ListItem") }}.Property(unwatched.count.large))</visible>
93+
<posx>{{ xoff - wbg_w - 36 }}</posx>
94+
<posy>{{ (yoff - 8)|vscale }}</posy>
95+
<width>{{ wbg_w + 56 }}</width>
96+
<height>{{ (wbg_h + 16)|vscale }}</height>
97+
<font>font32_title</font>
98+
<align>center</align>
99+
<aligny>center</aligny>
100+
<textcolor>{{ indicators.textcolor|default("FF000000") }}</textcolor>
101+
<label>$INFO[{{ itemref|default("ListItem") }}.Property(unwatched.count)]</label>
102+
</control>
79103
</control>
80104
{% endif %}
81105
{% endwith %}

0 commit comments

Comments
 (0)