Skip to content

Commit

Permalink
[MovieList] Make buildBeginTimeSortKey() return a 3 item tuple
Browse files Browse the repository at this point in the history
buildGroupwiseSortkey() mixes the return values of buildBeginTimeSortKey() and buildAlphaNumericSortKey() so both need to create a tuple of the same length, and each item in the tuple should be the same data type i.e. (int, str, int/float). If these don't correspond properly it will lead to crashes.
  • Loading branch information
Huevos committed Nov 19, 2021
1 parent 01bdb9b commit 4077877
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/python/Components/MovieList.py
Expand Up @@ -1005,8 +1005,8 @@ def buildAlphaNumericFlatSortKey(self, x):
def buildBeginTimeSortKey(self, x):
ref = x[0]
if ref.flags & eServiceReference.mustDescent and os.path.exists(ref.getPath()):
return 0, x[1] and -os.stat(ref.getPath()).st_mtime or 0
return 1, -x[2]
return 0, "", x[1] and -os.stat(ref.getPath()).st_mtime or 0
return 1, "", -x[2]

def buildGroupwiseSortkey(self, x):
# Sort recordings by date, sort MP3 and stuff by name
Expand Down

0 comments on commit 4077877

Please sign in to comment.