GliderGeek / pocket2rm

get articles from read-later platform pocket to the remarkable paper tablet
MIT License
184 stars 15 forks source link

Keep most recent Pocket articles at top #21

Open adrianlshaw opened 1 year ago

adrianlshaw commented 1 year ago

This is a great app, thanks for making it.

Do you have a way of showing most recent Pocket articles at the top?

I've been trying to change the sorting so that the most recent pocket bookmarks are at the top. By default the Remarkable sorts files alphabetically in ascending order, and has no option to reverse the sort to show in descending order.

I've tried something like the following. In utils.go, when converting to ePub or PDF, extract the date from the visible filename, convert that into a UNIX epoch timestamp, and then assign it to the lastModified attribute of the file. However, when using the remarkable UI to sort by "Last updated", it doesn't seem to work. Any ideas?

       s := strings.Split(visibleName, "_")
       date := s[0]
       layout := "20060102"
       t, err := time.Parse(layout, date)
       if err == nil {
               fmt.Printf("extracted %s and converted to %d\n", date, uint(t.Unix()))
               lastModified = uint(t.Unix())
       }
       lastModified = 1
GliderGeek commented 1 year ago

Thanks for the kind words!

good point of the sorting, would indeed be helpful when the newest ones are at the top. am not sure why the "Last updated" does not work, have to look into it.

you're comment also makes me think about the "remove to sync" file. does it currently have a correct place or should it be placed differently in the sorting?

adrianlshaw commented 1 year ago

"Remove to sync" is always at the bottom of the list. So I have to scroll all the way to the bottom to remove it. Easy if you have a short number of articles. But if you have a lot then it's a bit painful because, as you know, the Remarkable display takes a lot of slow refreshes to get to the bottom.

adrianlshaw commented 1 year ago

So ideally remove to sync would always be at the top :)