mirror of
https://github.com/koreader/koreader.git
synced 2025-12-13 20:36:53 +01:00
Various changes to sorting (#4067)
Don't consider sidecar file when sorting by access time. Rename 'sort by title' to 'sort by filename': This is in accordance with the actual function of the code, which uses filename rather than title as specified in file metadata.
This commit is contained in:
@@ -742,7 +742,7 @@ end
|
||||
function FileManager:getSortingMenuTable()
|
||||
local fm = self
|
||||
local collates = {
|
||||
strcoll = {_("title"), _("Sort by title")},
|
||||
strcoll = {_("filename"), _("Sort by filename")},
|
||||
access = {_("date read"), _("Sort by last read date")},
|
||||
change = {_("date added"), _("Sort by date added")},
|
||||
modification = {_("date modified"), _("Sort by date modified")},
|
||||
|
||||
@@ -126,12 +126,6 @@ function FileChooser:genItemTableFromPath(path)
|
||||
end
|
||||
elseif self.collate == "access" then
|
||||
sorting = function(a, b)
|
||||
if DocSettings:hasSidecarFile(a.fullpath) and not DocSettings:hasSidecarFile(b.fullpath) then
|
||||
return true
|
||||
end
|
||||
if not DocSettings:hasSidecarFile(a.fullpath) and DocSettings:hasSidecarFile(b.fullpath) then
|
||||
return false
|
||||
end
|
||||
return a.attr.access > b.attr.access
|
||||
end
|
||||
elseif self.collate == "modification" then
|
||||
|
||||
Reference in New Issue
Block a user