File tree Expand file tree Collapse file tree 4 files changed +10
-21
lines changed Expand file tree Collapse file tree 4 files changed +10
-21
lines changed Original file line number Diff line number Diff line change 11# coding=utf-8
22import kodigui
3+ from lib import util
34
45
56class MLCPaginator (object ):
@@ -189,4 +190,12 @@ def createListItem(self, rel):
189190 rel .title or '' ,
190191 thumbnailImage = rel .defaultThumb .asTranscodedImageURL (* self .parentWindow .RELATED_DIM ),
191192 data_source = rel
192- )
193+ )
194+
195+ def prepareListItem (self , data , mli ):
196+ if data .type in ('season' , 'show' ):
197+ if not mli .dataSource .isWatched :
198+ mli .setProperty ('unwatched.count' , str (mli .dataSource .unViewedLeafCount ))
199+ else :
200+ mli .setProperty ('unwatched' , not mli .dataSource .isWatched and '1' or '' )
201+ mli .setProperty ('progress' , util .getProgressImage (mli .dataSource ))
Original file line number Diff line number Diff line change @@ -27,10 +27,6 @@ class RelatedPaginator(pagination.BaseRelatedPaginator):
2727 def getData (self , offset , amount ):
2828 return self .parentWindow .video .getRelated (offset = offset , limit = amount )
2929
30- def prepareListItem (self , data , mli ):
31- mli .setProperty ('unwatched' , not mli .dataSource .isWatched and '1' or '' )
32- mli .setProperty ('progress' , util .getProgressImage (mli .dataSource ))
33-
3430
3531class PrePlayWindow (kodigui .ControlledWindow , windowutils .UtilMixin ):
3632 xmlFile = 'script-plex-pre_play.xml'
Original file line number Diff line number Diff line change @@ -29,14 +29,6 @@ class RelatedPaginator(pagination.BaseRelatedPaginator):
2929 def getData (self , offset , amount ):
3030 return self .parentWindow .mediaItem .getRelated (offset = offset , limit = amount )
3131
32- def prepareListItem (self , data , mli ):
33- if data .type in ('show' , 'season' ):
34- if not mli .dataSource .isWatched :
35- mli .setProperty ('unwatched.count' , str (mli .dataSource .unViewedLeafCount ))
36- else :
37- mli .setProperty ('unwatched' , not mli .dataSource .isWatched and '1' or '' )
38- mli .setProperty ('progress' , util .getProgressImage (mli .dataSource ))
39-
4032
4133class ShowWindow (kodigui .ControlledWindow , windowutils .UtilMixin ):
4234 xmlFile = 'script-plex-seasons.xml'
Original file line number Diff line number Diff line change @@ -30,14 +30,6 @@ def readyForPaging(self):
3030 def getData (self , offset , amount ):
3131 return (self .parentWindow .prev or self .parentWindow .next ).getRelated (offset = offset , limit = amount )
3232
33- def prepareListItem (self , data , mli ):
34- if self .parentWindow .prev and self .parentWindow .prev .type == 'episode' :
35- if not mli .dataSource .isWatched :
36- mli .setProperty ('unwatched.count' , str (mli .dataSource .unViewedLeafCount ))
37- else :
38- mli .setProperty ('unwatched' , not mli .dataSource .isWatched and '1' or '' )
39- mli .setProperty ('progress' , util .getProgressImage (mli .dataSource ))
40-
4133
4234class OnDeckPaginator (pagination .MLCPaginator ):
4335 def readyForPaging (self ):
You can’t perform that action at this time.
0 commit comments