flackbash / AudioAnchor

Android audio player that tracks the listening progress of your audio books and podcasts
GNU General Public License v3.0
218 stars 41 forks source link

New feature: Categorize albums by progress #193

Open J0J0 opened 1 year ago

J0J0 commented 1 year ago

This is related to #90 and #104, although it does not strictly solve those exact issues.

I added the following feature: In the main activity, the albums are first categorized as either of

and then displayed in that order (while keeping the order in each category as before).

I have an ad-hoc solution for this at hacky-albumsort: It simply uses the data from the cursor, calculates the above ordering, and feeds it back to the framework as MatrixCursor.

While this works (i'm actively using it), it is not quite elegant. In fact, all the computations can be done by the database: for the baby case of a single album (DBAccessUtils::getAlbumTimes), albumtimes shows how to ask the database directly to sum up the album times.

The general case is implemented in poc-better-albumsort. In order to execute the necessary SELECT query, i needed to amend the content provider with a new query-only path ALBUM_WITH_TIMES. I call it proof of concept, because in the present state, it has several deficiencies: