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
22
default.py
22
default.py
|
@ -410,6 +410,7 @@ def sortTitles(channelInitial=""):
|
||||||
def showArtist(style, limit, start):
|
def showArtist(style, limit, start):
|
||||||
# limit artists by first letter or country
|
# limit artists by first letter or country
|
||||||
data = getArtists()
|
data = getArtists()
|
||||||
|
preresult = []
|
||||||
result = []
|
result = []
|
||||||
# xbmc.log(msg=url, level=xbmc.LOGNOTICE)
|
# xbmc.log(msg=url, level=xbmc.LOGNOTICE)
|
||||||
# xbmc.log(msg=style, 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()
|
i = unidecode(entry['artist'])[0].upper()
|
||||||
if limit == '#':
|
if limit == '#':
|
||||||
if not re.match('^([a-z|A-Z])', i):
|
if not re.match('^([a-z|A-Z])', i):
|
||||||
result.append(entry)
|
preresult.append(entry)
|
||||||
else:
|
else:
|
||||||
if limit == i:
|
if limit == i:
|
||||||
result.append(entry)
|
preresult.append(entry)
|
||||||
elif style == 'country':
|
elif style == 'country':
|
||||||
|
|
||||||
for entry in data:
|
for entry in data:
|
||||||
i = entry['countrycode']
|
i = entry['countrycode']
|
||||||
if limit == i:
|
if limit == i:
|
||||||
result.append(entry)
|
preresult.append(entry)
|
||||||
elif limit == 'unknown':
|
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)
|
result.append(entry)
|
||||||
|
elif videoselection == "1":
|
||||||
|
if entry['unofficial'] >= "1":
|
||||||
|
result.append(entry)
|
||||||
|
elif videoselection == "2":
|
||||||
|
result.append(entry)
|
||||||
|
|
||||||
maximum = len(result)
|
maximum = len(result)
|
||||||
for entry in result[start:end]:
|
for entry in result[start:end]:
|
||||||
artist = entry['artist']
|
artist = entry['artist']
|
||||||
|
@ -448,10 +460,8 @@ def showArtist(style, limit, start):
|
||||||
fanart = ""
|
fanart = ""
|
||||||
|
|
||||||
if videoselection == "0":
|
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":
|
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":
|
elif videoselection == "2":
|
||||||
addDir("%s (%s/%s)" % (artist, official, unofficial), unidecode(artist.upper()), 'sortArtists', fanart, (official + unofficial))
|
addDir("%s (%s/%s)" % (artist, official, unofficial), unidecode(artist.upper()), 'sortArtists', fanart, (official + unofficial))
|
||||||
|
|
Loading…
Reference in a new issue