BLeeEZ / amperfy

Amperfy is an iOS/iPadOS/macOS app to play songs from an Ampache or Subsonic server
GNU General Public License v3.0
501 stars 40 forks source link

Show more than 5 albums under recent. #172

Closed mediadev123 closed 6 months ago

mediadev123 commented 1 year ago

It would be great if there are more albums under the recent tab. It's currently limited to 5 which is very easy to reach, especially when you rip a lot of albums at once.

50 or even 100 would be a much more reasonable limit IMO.

It also seems like there is a bug that causes one album to appear 3 times under recent:

IMG_2288

bbsixzz commented 1 year ago

I see 20, it might be your server config (I run navidrome).

mediadev123 commented 1 year ago

What's the exact URL that is being generated? For the amapache API, https://[redacted]/server/json.server.php?action=stats&type=album&filter=newest&offset=0&limit=100&auth=secret&version=5.5.6 returns exactly 100.

BLeeEZ commented 1 year ago

The count of albums and songs displayed under recent depends on the server API. Subsonic only supports polling recent albums. So I poll the top 20 albums and under recent songs I display the songs of those albums. Ampache on the other hand only supports polling recent songs. So I poll the top 100 songs and under recent albums I display the albums corresponding to those songs.

mediadev123 commented 1 year ago

Ampache on the other hand only supports polling recent songs. So I poll the top 100 songs and under recent albums I display the albums corresponding to those songs.

Are you sure about that? Because I can pull recent songs and albums with the API endpoint I have shown you.

BLeeEZ commented 1 year ago

I wasn’t aware that recent albums can be pulled via that url. Currently Amperfy polls via advanced_search.

func requestRecentSongs(count: Int) -> Promise<Data> { return request { auth in var urlComp = try self.createAuthApiUrlComponent(auth: auth) urlComp.addQueryItem(name: "action", value: "advanced_search") urlComp.addQueryItem(name: "rule_1", value: "recent_added") urlComp.addQueryItem(name: "rule_1_operator", value: 0) urlComp.addQueryItem(name: "rule_1_input", value: count) urlComp.addQueryItem(name: "type", value: "song") return try self.createUrl(from: urlComp) } }

bbsixzz commented 9 months ago

Could you please let us configure how many recent albums to show in display settings? I've been adding many albums lately and lose track after 20.

Alternatively just pull another 20 when scrolling down. An infinite timeline of recent albums can be very useful.

BLeeEZ commented 9 months ago

Hi all, I am currently reworking the complete "recently added" system. I will remove the "Recent Songs" from library due to missing API support. Subsonic has no function to get the newest songs and the Ampache API only returns random newest songs via the stats method. "Recent Albums" is perfectly supported on both APIs (@mediadev123 thanks for the correct Ampache API function).

I will rework the "Recent Albums" in two steps:

  1. Fetch 50 entries and note the date
  2. When the user reached the bottom of the table Amperfy will fetch 50 new entries and so on (Infinite scroll via pagination).

Some inconsistency errors can occur when more then 50 albums have been added between to Amperfy syncs. To mitigate that I will a button to "Settings->Library" to reset "Recently Albums" table information. After that the cached order/appearance of this view is reset and will be reconstructed again during scrolling.

BLeeEZ commented 9 months ago

"Recent Albums" will be renamed to "Newest Albums" too. I am planing to support "Recently played Songs/Albums" in the future and that will then be named "Recent Songs"/"Recent Albums".

BLeeEZ commented 8 months ago

Done in e462a6bd13ad9e48f60017954887788ceb127929

Newest and Recently Player Albums are supported. It is implemented via endless scroll and the rows visible to the user are always updated.

BLeeEZ commented 7 months ago

This feature can be tested in v1.2.0 (1). It is now available as Beta via TestFlight: https://github.com/BLeeEZ/amperfy/issues/25