{"action":"created","issue":{"url":"https://api.github.com/repos/koreader/koreader/issues/4067","repository_url":"https://api.github.com/repos/koreader/koreader","labels_url":"https://api.github.com/repos/koreader/koreader/issues/4067/labels{/name}","comments_url":"https://api.github.com/repos/koreader/koreader/issues/4067/comments","events_url":"https://api.github.com/repos/koreader/koreader/issues/4067/events","html_url":"https://github.com/koreader/koreader/pull/4067","id":339679788,"node_id":"MDExOlB1bGxSZXF1ZXN0MjAwMjczMzI5","number":4067,"title":"Various changes to sorting","user":{"login":"alethiophile","id":1498611,"node_id":"MDQ6VXNlcjE0OTg2MTE=","avatar_url":"https://avatars0.githubusercontent.com/u/1498611?v=4","gravatar_id":"","url":"https://api.github.com/users/alethiophile","html_url":"https://github.com/alethiophile","followers_url":"https://api.github.com/users/alethiophile/followers","following_url":"https://api.github.com/users/alethiophile/following{/other_user}","gists_url":"https://api.github.com/users/alethiophile/gists{/gist_id}","starred_url":"https://api.github.com/users/alethiophile/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alethiophile/subscriptions","organizations_url":"https://api.github.com/users/alethiophile/orgs","repos_url":"https://api.github.com/users/alethiophile/repos","events_url":"https://api.github.com/users/alethiophile/events{/privacy}","received_events_url":"https://api.github.com/users/alethiophile/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":6,"created_at":"2018-07-10T03:26:22Z","updated_at":"2018-07-11T13:03:26Z","closed_at":null,"author_association":"CONTRIBUTOR","pull_request":{"url":"https://api.github.com/repos/koreader/koreader/pulls/4067","html_url":"https://github.com/koreader/koreader/pull/4067","diff_url":"https://github.com/koreader/koreader/pull/4067.diff","patch_url":"https://github.com/koreader/koreader/pull/4067.patch"},"body":"I'm using this for several changes I'd like to make to the file sorting code, some of which will require consultation.\r\n\r\n* When sorting by atime/\"last read\", don't force entries without a sidecar file to the end of the list.\r\n\r\n  Doing so technically fits the \"when last read\" criterion, but it also has the effect of shuffling newly added files to the end. I think that in practice, a newly added file is equally of interest to the user as a just-opened one, and so both should be at the beginning. All that's required here is to remove the special case for sidecar files; when a file is added, its atime is set to the mtime, so the sort key works automatically. This is implemented in the commit present now. \r\n* Fix or remove the \"date added\" entry\r\n\r\n  Currently, the \"sort by date added\" setting has the effect of sorting by ctime (change time). This is almost certainly incorrect; ctime is updated whenever the file data or metadata changes, and so in this instance should be basically equivalent to mtime (which is already present under the \"date modified\" header as a different setting). I can't think of a good use for a ctime sort setting. The alternative would be to implement a real sort by date added, which would require adding some external metadata (since there's no way to get creation time from the inode) and would in most cases be identical to \"date modified\" anyway. (The exception here is when books are changed/updated after they're added; however, in such cases it usually seems that an updated book should also be at the front of the list.)\r\n\r\n  I'm somewhat inclined to just remove that setting rather than try to add nontrivial and questionably useful new functionality to make it work as described. The current status quo is a straightforward conflict between description and code; I think something definitely needs to change.\r\n* Make title actually sort by title\r\n\r\n  Currently, \"sort by title\" actually sorts by the underlying filename, which is only occasionally equivalent to the title in the metadata, and isn't visible in the file manager (when using the cover-browser plugin) at all. It seems this should definitely sort by the metadata title, at least when cover-browser is active. However, the code that knows about the metadata browser display is all inside cover-browser; it may be this change should be implemented there, via some monkey-patch magic like it already uses, to keep the sort order and the displayed title from having a mismatch.\r\n\r\nThese issues are definitely open to discussion as to how they should be resolved; I'd appreciate any commentary on my proposed fixes."},"comment":{"url":"https://api.github.com/repos/koreader/koreader/issues/comments/404161114","html_url":"https://github.com/koreader/koreader/pull/4067#issuecomment-404161114","issue_url":"https://api.github.com/repos/koreader/koreader/issues/4067","id":404161114,"node_id":"MDEyOklzc3VlQ29tbWVudDQwNDE2MTExNA==","user":{"login":"NiLuJe","id":111974,"node_id":"MDQ6VXNlcjExMTk3NA==","avatar_url":"https://avatars3.githubusercontent.com/u/111974?v=4","gravatar_id":"","url":"https://api.github.com/users/NiLuJe","html_url":"https://github.com/NiLuJe","followers_url":"https://api.github.com/users/NiLuJe/followers","following_url":"https://api.github.com/users/NiLuJe/following{/other_user}","gists_url":"https://api.github.com/users/NiLuJe/gists{/gist_id}","starred_url":"https://api.github.com/users/NiLuJe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/NiLuJe/subscriptions","organizations_url":"https://api.github.com/users/NiLuJe/orgs","repos_url":"https://api.github.com/users/NiLuJe/repos","events_url":"https://api.github.com/users/NiLuJe/events{/privacy}","received_events_url":"https://api.github.com/users/NiLuJe/received_events","type":"User","site_admin":false},"created_at":"2018-07-11T13:03:26Z","updated_at":"2018-07-11T13:03:26Z","author_association":"MEMBER","body":"I think someone took care of atime recently by adding a touch, so at least for stuff opened by KOReader itself, we're good."}}
{"actor":{"display_login":"NiLuJe"}}