remove some not needed cruft

This commit is contained in:
bassdart 2019-02-14 17:14:54 +01:00
parent 6efa5beb33
commit c1783e3631

View file

@ -487,20 +487,6 @@ def sortArtists(channel=""):
channel = params[0]
if len(params) > 1:
start = params[1]
if channel != "" and channel != "relaartists":
fanart = getFanart(channel)
for entry in data:
artists_upper = [unidecode(artist.upper()) for artist in entry['artists']]
if channel in artists_upper:
if videoselection == "0":
if "true" in entry['official'].lower():
result.append(entry)
elif videoselection == "1":
if "false" in entry['official'].lower():
result.append(entry)
else:
result.append(entry)
#show "more from..." artists
if channel != "" and channel == "relartists":
fanart = getFanart(channel)
@ -510,7 +496,6 @@ def sortArtists(channel=""):
channels = []
for channel in artists_upper:
channels.append(channel)
xbmc.log(msg=str(channels), level=xbmc.LOGNOTICE)
# nested loops don't look like an optimal solution and are a bit slow
for entry in data:
@ -541,9 +526,9 @@ def sortTitlesBy(limit, sort, start):
start = int(start)
end = start + filesinlists
nextstart = end + 1
# xbmc.log(msg=channel, level=xbmc.LOGNOTICE)
fanart = getFanart(channel)
# limit to hits
if hit != "" and hit == "true":
for entry in data:
@ -558,6 +543,7 @@ def sortTitlesBy(limit, sort, start):
result.append(entry)
data = result
result = []
# played often at provider
if mycount != "" and mycount == "pcount" and sort != "count":
for entry in data:
@ -571,9 +557,9 @@ def sortTitlesBy(limit, sort, start):
result.append(entry)
elif videoselection == "2":
result.append(entry)
# xbmc.log(msg=str(entry['pcount']), level=xbmc.LOGNOTICE)
data = result
result = []
# played often by addon developer
if mycount != "" and mycount == "acount" and sort != "count":
for entry in data:
@ -586,7 +572,6 @@ def sortTitlesBy(limit, sort, start):
result.append(entry)
elif videoselection == "2":
result.append(entry)
# xbmc.log(msg=str(entry['pcount']), level=xbmc.LOGNOTICE)
data = result
result = []
@ -602,7 +587,6 @@ def sortTitlesBy(limit, sort, start):
result.append(entry)
elif videoselection == "2":
result.append(entry)
# xbmc.log(msg=str(entry['pcount']), level=xbmc.LOGNOTICE)
data = result
result = []
@ -634,7 +618,6 @@ def sortTitlesBy(limit, sort, start):
result.append(entry)
elif videoselection == "2":
result.append(entry)
# xbmc.log(msg=str(entry['pcount']), level=xbmc.LOGNOTICE)
data = result
result = []
@ -650,7 +633,6 @@ def sortTitlesBy(limit, sort, start):
result.append(entry)
elif videoselection == "2":
result.append(entry)
# xbmc.log(msg=str(entry['pcount']), level=xbmc.LOGNOTICE)
data = result
result = []
@ -671,7 +653,6 @@ def sortTitlesBy(limit, sort, start):
elif channel != "" and channel == "year":
lastyear = datetime.now() - timedelta(days=365)
for entry in data:
# dateadded = entry['dateadded']
# ehrm, first version worked for many days but now fails?
# related to https://bugs.python.org/issue27400 ?
try:
@ -691,7 +672,6 @@ def sortTitlesBy(limit, sort, start):
# related tracks (generated with musly)
elif channel != "" and channel == "related":
start = str(start)
# xbmc.log(msg=str(start), level=xbmc.LOGNOTICE)
for entry in data:
if entry['slug'] == start:
slugs = []
@ -703,7 +683,6 @@ def sortTitlesBy(limit, sort, start):
for entry in data:
# add all related slugs
if entry['slug'] in slugs:
#xbmc.log(msg=str(result['artists']), level=xbmc.LOGNOTICE)
# filter out tracks with the same title, where only the video differs.
# if a related slug is listed earlier in data (= newer video) the
# main slug will be filtered out.
@ -746,7 +725,6 @@ def sortTitlesBy(limit, sort, start):
xbmc.log(msg=str(artists), level=xbmc.LOGNOTICE)
# add all entries with artist in artists
if entry['artists'] in artists:
# xbmc.log(msg=str(entry), level=xbmc.LOGNOTICE)
if videoselection != "2" and relatedselection != "true":
if videoselection == "0":
if "true" in entry['official']:
@ -756,7 +734,6 @@ def sortTitlesBy(limit, sort, start):
result.append(entry)
else:
result.append(entry)
maximum = len(result)
start = 0
# not used anywhere?
@ -776,14 +753,12 @@ def sortTitlesBy(limit, sort, start):
result = result[:filesinlists]
start = 0
end = filesinlists
# maximum = filesinlists - 1
if sort != "" and sort == "date":
if channel != "":
modus = channel
else:
modus = 'all'
result = result
# maximum = len(result)
if sort != "" and sort == "count":
if channel != "":
modus = channel
@ -798,9 +773,6 @@ def sortTitlesBy(limit, sort, start):
#from operator import itemgetter
#result = sorted(result, key=itemgetter((float(mycount), 'title'),reverse = True))
# maximum = len(result)
# else:
# maximum = len(result)
# play all (TODO)
# addDir(translation(30109), '', '', fanart)
# back to VIDFLTR (only useful if the back history would be cleared)