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