CappielloAntonio / tempo

An open source and lightweight music client for Subsonic, designed and built natively for Android.
GNU General Public License v3.0
867 stars 39 forks source link

fix: Fix issues with AlbumCatalogue #150

Closed GallowsDove closed 5 months ago

GallowsDove commented 5 months ago

There are currently several issues with AlbumCatalogue implementation:

This PR seeks to fix all of these issues.

It currently always fetches the AlbumList from server each time it is opened, this could however be easily changed to just cache the result of the first load. Let me know what you think.

Resolves #146

CappielloAntonio commented 5 months ago

This was one of the things that could have been done differently, whether it was right or wrong. Unlike artists, the subsonic API returns albums in segments of up to 500 components. Which means I don't build the whole interface with a one shot call like for artists, but have to wait and assemble the interface from call to call. Your reasoning is absolutely correct, use a semaphore that controls the loading state and that regulates it based on the state of the UI.

As a result, the search is also not clean (but again, it's not a search, but a filter).

The alternative would have been to take the user to the SearchFragment and delegate all types of searches to that screen.

GallowsDove commented 5 months ago

@CappielloAntonio It's possible to fetch all albums at once, using the search3 function with no query (query parameter has to be empty, not missing), however from my testing on my personal library, it takes quite a long time so I believe this approach is better as it avoids staring at a blank screen for quite some time until it loads.