From b572f564c91d86f6f3066179126f2310ad2a7c6e Mon Sep 17 00:00:00 2001 From: bassdart Date: Mon, 11 Feb 2019 16:59:23 +0100 Subject: [PATCH] fix pager enumeration in main artist and country if Video Selection isn't set to show all videos --- default.py | 26 ++++++++++++++++++-------- 1 file changed, 18 insertions(+), 8 deletions(-) diff --git a/default.py b/default.py index b89e74b..d3d029f 100644 --- a/default.py +++ b/default.py @@ -410,6 +410,7 @@ def sortTitles(channelInitial=""): def showArtist(style, limit, start): # limit artists by first letter or country data = getArtists() + preresult = [] result = [] # xbmc.log(msg=url, level=xbmc.LOGNOTICE) # xbmc.log(msg=style, level=xbmc.LOGNOTICE) @@ -422,18 +423,29 @@ def showArtist(style, limit, start): i = unidecode(entry['artist'])[0].upper() if limit == '#': if not re.match('^([a-z|A-Z])', i): - result.append(entry) + preresult.append(entry) else: if limit == i: - result.append(entry) + preresult.append(entry) elif style == 'country': - for entry in data: i = entry['countrycode'] if limit == i: - result.append(entry) + preresult.append(entry) elif limit == 'unknown': + preresult.append(entry) + + # limit the result list according to the "Video Selection" Setting + for entry in preresult: + if videoselection == "0": + if entry['official'] >= "1": result.append(entry) + elif videoselection == "1": + if entry['unofficial'] >= "1": + result.append(entry) + elif videoselection == "2": + result.append(entry) + maximum = len(result) for entry in result[start:end]: artist = entry['artist'] @@ -448,11 +460,9 @@ def showArtist(style, limit, start): fanart = "" if videoselection == "0": - if entry['official'] >= "1": - addDir("%s (%s)" % (artist, official), unidecode(artist.upper()), 'sortArtists', fanart, official) + addDir("%s (%s)" % (artist, official), unidecode(artist.upper()), 'sortArtists', fanart, official) elif videoselection == "1": - if entry['unofficial'] >= "1": - addDir("%s (%s)" % (artist, unofficial), unidecode(artist.upper()), 'sortArtists', fanart, unofficial) + addDir("%s (%s)" % (artist, unofficial), unidecode(artist.upper()), 'sortArtists', fanart, unofficial) elif videoselection == "2": addDir("%s (%s/%s)" % (artist, official, unofficial), unidecode(artist.upper()), 'sortArtists', fanart, (official + unofficial)) if maximum > end: