fix pager enumeration in main artist and country if Video Selection isn't set to show all videos
This commit is contained in:
parent
4222f04793
commit
b572f564c9
1 changed files with 18 additions and 8 deletions
26
default.py
26
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:
|
||||
|
|
Loading…
Reference in a new issue