add page counter for sorted folders

This commit is contained in:
bassdart 2019-02-14 16:54:34 +01:00
parent 32a8310491
commit 6efa5beb33

View file

@ -776,14 +776,14 @@ def sortTitlesBy(limit, sort, start):
result = result[:filesinlists]
start = 0
end = filesinlists
maximum = filesinlists - 1
# maximum = filesinlists - 1
if sort != "" and sort == "date":
if channel != "":
modus = channel
else:
modus = 'all'
result = result
maximum = len(result)
# maximum = len(result)
if sort != "" and sort == "count":
if channel != "":
modus = channel
@ -798,9 +798,9 @@ 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)
# 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)
@ -811,12 +811,17 @@ def sortTitlesBy(limit, sort, start):
# playlist.clear()
for entry in result[start:end]:
addVideo(entry, mycount)
maximum = len(result)
if maximum > end and sort != "random" and channel != "year":
pagemax = (float(maximum) / float(filesinlists))
pagenext = (float(nextstart) / float(filesinlists))
# next page link
if sort != "" and sort == "count":
addDir(translation(30036), '&limit=' + modus + '&sort=count&start=' + str(nextstart) + '&count=' + mycount, 'sortTitlesBy', fanart)
addDir("%s: %s/%s" % (translation(30036), str(int(math.ceil(pagenext))), str(int(math.ceil(pagemax)))), '&limit=' + modus + '&sort=count&start=' + str(nextstart) + '&count=' + mycount, 'sortTitlesBy', fanart)
elif hit != "" and hit == "true":
addDir("%s: %s/%s" % (translation(30036), str(int(math.ceil(pagenext))), str(int(math.ceil(pagemax)))), '&limit=' + modus + '&sort=date&start=' + str(nextstart) + '&hit=true', 'sortTitlesBy', fanart)
else:
addDir(translation(30036), '&limit=' + modus + '&sort=date&start=' + str(nextstart), 'sortTitlesBy', fanart)
addDir("%s: %s/%s" % (translation(30036), str(int(math.ceil(pagenext))), str(int(math.ceil(pagemax)))), '&limit=' + modus + '&sort=date&start=' + str(nextstart), 'sortTitlesBy', fanart)
endOfDirectory()