Bookplayer: Library: Sort by recently played

Created on 6 May 2020  ยท  14Comments  ยท  Source: TortugaPower/BookPlayer

Extracted from #456 - https://github.com/TortugaPower/BookPlayer/issues/456#issuecomment-624282846

I think this is something much more doable: Currently I'm only seeing sort by Title or Original File name, so it would be great if there was a way to sort audio files played by most Recent (recently played).

enhancement good for beginners help wanted

All 14 comments

I may be able to take a stab at this. Could you give me some direction - for instance, which class does the library gets loaded and where are the sorting options that I need to change? My hunch would be the PlayListSortOrder within BookSortService class, is this correct and is that the only place that changes need to be made?

Hi @iamLoi !, that would be great, since the Watch app was introduced (or maybe CarPlay ๐Ÿค” not sure right now), the LibraryItem abstract class has had the lastPlayDate property. That could be used to sort the books by recently played (actually for CarPlay we use getItemsOrderedByDate in the Library class)

But well, yes you're on the right track, within BookSortService in the enum PlayListSortOrder there should be a new case with the raw value being lastPlayDate, and you should add the new option in the action sheet as well (inside the file ItemListAlerts.swift)

For localization, use the content of the carplay_recent_title key, mmmm or maybe we could rename it from carplay_recent_title to just recent_title and use that everywhere

Let me know if you got any other question ๐Ÿ‘

Any commands or anything I need to run to get all the dependencies ready to build/run the project? This project uses Carthage so I ran carthage update --platform macOS but it's showing Carthage as deprecated (?) and runs still fail due to different modules not available (SwiftReorder in particular). I haven't done much Swift or Xcode programming so this is new for me.

I made another branch and pushed my changes. Please verify and let me know if there's anything missing, otherwise feel free to merge it.

@iamLoi โค thanks for joining the effort. To allow us to merge or review your work, you need to create a fork and create a pull request.

@iamLoi I'll leave my comments on the PR ๐Ÿ‘

@GianniCarlo If is this still pending, can i take a stab at it ?

sure!, there's a PR opened #460 but after some feedback about project building, there hasn't been any updates to it. So you're welcome to do it ๐Ÿ‘Œ

@GianniCarlo Thanks a lot. That PR was confusing for me and had many unwanted changes. I have implemented here in this PR

https://github.com/TortugaPower/BookPlayer/pull/475

@GianniCarlo can you close this issue ? The PR is merged

wops I forgot ๐Ÿ˜…, closing it now ๐Ÿ‘

@mmurali88 if you add Closes #number to the description of the PR, the reference and closing will happen automatically when the PR is merged ๐Ÿ‘

@mmurali88 if you add Closes #number to the description of the PR, the reference and closing will happen automatically when the PR is merged ๐Ÿ‘

Thanks @pichfl . Will do that going forward

Was this page helpful?
0 / 5 - 0 ratings

Related issues

stemcc picture stemcc  ยท  3Comments

halleygen picture halleygen  ยท  3Comments

gabiionut picture gabiionut  ยท  4Comments

pichfl picture pichfl  ยท  6Comments

Resonanz picture Resonanz  ยท  3Comments