add page counter for sorted folders
This commit is contained in:
parent
32a8310491
commit
6efa5beb33
1 changed files with 12 additions and 7 deletions
19
default.py
19
default.py
|
@ -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()
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue