ampache / ampache

A web based audio/video streaming application and file manager allowing you to access your music & videos from anywhere, using almost any internet enabled device.
http://ampache.org
GNU Affero General Public License v3.0
3.47k stars 587 forks source link

Subsonic clients show multidisc albums/tracks incorrectly #3257

Open already-used-name opened 2 years ago

already-used-name commented 2 years ago

Description

Describe the bug

Albums with multiple discs appear as multiple albums, and the combined total tracks is either shown in every 'album' or just in one and the others are empty. For example, an album with 3 discs and 46 tracks in total (disc 1 has 22, disc 2 as 22 and disc 3 has 2) shows in Subsonic clients as 3 albums, and they all show 46 tracks each (DSub/Subtracks on Android) or only one of them has tracks (Sublime Music on Linux).

To reproduce

Steps to reproduce the behavior:

  1. Access Ampache through a Subsonic client
  2. Check the contents of multidisc albums

Expected behavior

Each disc should display only the tracks belonging to it.

Screenshots

1 2 3

Environment

Client type

Logs

This is what I get when accessing the album in the screenshots:

2022-05-07T02:08:00-05:00 [] (Ampache\Module\System\Dba) -> Database connection...
2022-05-07T02:08:00-05:00 [user] (Ampache\Module\Api\Subsonic_Xml_Data) -> API success in function ping-1.13.0
2022-05-07T02:08:44-05:00 [] (Ampache\Module\System\Dba) -> Database connection...
2022-05-07T02:08:44-05:00 [] (Ampache\Module\System\Dba) -> Database connection...
2022-05-07T02:08:44-05:00 [user] (Ampache\Module\Api\Subsonic_Xml_Data) -> API success in function saveplayqueue-1.13.0
2022-05-07T02:08:44-05:00 [user] (Ampache\Module\Api\Subsonic_Xml_Data) -> API success in function saveplayqueue-1.13.0
2022-05-07T02:08:44-05:00 [] (Ampache\Module\System\Dba) -> Database connection...
2022-05-07T02:08:45-05:00 [user] (Ampache\Module\Api\Subsonic_Xml_Data) -> API success in function saveplayqueue-1.13.0
2022-05-07T02:08:45-05:00 [] (Ampache\Module\System\Dba) -> Database connection...
2022-05-07T02:08:45-05:00 [user] (Ampache\Module\Api\Subsonic_Xml_Data) -> API success in function saveplayqueue-1.13.0
2022-05-07T02:08:45-05:00 [] (Ampache\Module\System\Dba) -> Database connection...
2022-05-07T02:08:45-05:00 [user] (Ampache\Module\Api\Subsonic_Xml_Data) -> API success in function saveplayqueue-1.13.0
2022-05-07T02:08:45-05:00 [] (Ampache\Module\System\Dba) -> Database connection...
2022-05-07T02:08:45-05:00 [user] (Ampache\Module\Api\Subsonic_Xml_Data) -> API success in function saveplayqueue-1.13.0
2022-05-07T02:08:45-05:00 [] (Ampache\Module\System\Dba) -> Database connection...
2022-05-07T02:08:45-05:00 [user] (Ampache\Module\Api\Subsonic_Xml_Data) -> API success in function saveplayqueue-1.13.0
2022-05-07T02:08:45-05:00 [] (Ampache\Module\System\Dba) -> Database connection...
2022-05-07T02:08:45-05:00 [] (Ampache\Module\System\Dba) -> Database connection...
2022-05-07T02:08:45-05:00 [user] (Ampache\Module\Api\Subsonic_Xml_Data) -> API success in function saveplayqueue-1.13.0
2022-05-07T02:08:45-05:00 [] (Ampache\Module\System\Dba) -> Database connection...
2022-05-07T02:08:45-05:00 [user] (Ampache\Module\Api\Subsonic_Xml_Data) -> API success in function saveplayqueue-1.13.0
2022-05-07T02:08:45-05:00 [user] (Ampache\Module\Api\Subsonic_Xml_Data) -> API success in function saveplayqueue-1.13.0
2022-05-07T02:08:45-05:00 [] (Ampache\Module\System\Dba) -> Database connection...
2022-05-07T02:08:45-05:00 [] (Ampache\Module\System\Dba) -> Database connection...
2022-05-07T02:08:45-05:00 [user] (Ampache\Module\Api\Subsonic_Xml_Data) -> API success in function saveplayqueue-1.13.0
2022-05-07T02:08:45-05:00 [] (Ampache\Module\System\Dba) -> Database connection...
2022-05-07T02:08:45-05:00 [user] (Ampache\Module\Api\Subsonic_Xml_Data) -> API success in function saveplayqueue-1.13.0
2022-05-07T02:08:45-05:00 [] (Ampache\Module\System\Dba) -> Database connection...
2022-05-07T02:08:45-05:00 [user] (Ampache\Module\Api\Subsonic_Xml_Data) -> API success in function saveplayqueue-1.13.0
2022-05-07T02:08:45-05:00 [] (Ampache\Module\System\Dba) -> Database connection...
2022-05-07T02:08:45-05:00 [user] (Ampache\Module\Api\Subsonic_Xml_Data) -> API success in function saveplayqueue-1.13.0
2022-05-07T02:08:45-05:00 [user] (Ampache\Module\Api\Subsonic_Xml_Data) -> API success in function saveplayqueue-1.13.0
2022-05-07T02:08:46-05:00 [] (Ampache\Module\System\Dba) -> Database connection...
2022-05-07T02:08:46-05:00 [user] (Ampache\Module\System\Session) -> Session created: 153c1423aa378d9a9988931c5a6ca1e2
2022-05-07T02:08:46-05:00 [user] (Ampache\Module\Api\Subsonic_Api) -> Stream proxy: https://example.com:443/play/index.php?ssid=153c1423aa378d9a9988931c5a6ca1e2&type=song&oid=1414&uid=1&client=Sublime%20Music&player=api&name=Blue123%20-%20Caged%20Heart.mp3
2022-05-07T02:08:47-05:00 [] (Ampache\Module\System\Dba) -> Database connection...
2022-05-07T02:08:47-05:00 [] (Ampache\Module\Application\ApplicationRunner) -> Found handler "Ampache\Module\Application\Playback\PlayAction" for action "play"
2022-05-07T02:08:47-05:00 [] (play/index) -> Asked for type {song}
2022-05-07T02:08:47-05:00 [user] (Ampache\Module\System\Session) -> 153c1423aa378d9a9988931c5a6ca1e2 has been extended to Sat, 07 May 2022 04:08:47 -0500 extension length 7200
2022-05-07T02:08:47-05:00 [user] (Ampache\Repository\Model\User) -> Login from IP address: xxx.xxx.xxx.xxx
2022-05-07T02:08:47-05:00 [user] (play/index) -> stream file (/musicpath/Katawa Shoujo Enigmatic Box of Sound/1-04 Caged Heart.mp3}...
2022-05-07T02:08:47-05:00 [user] (play/index) -> Media type {mp3}
2022-05-07T02:08:47-05:00 [user] (play/index) -> Registering stream @1651907327 for 1: Blue123 - Caged Heart {1414}
2022-05-07T02:08:47-05:00 [user] (Ampache\Module\User\Activity\UserActivityPoster) -> post_activity: play song by user: 1: {1414}
2022-05-07T02:08:47-05:00 [user] (lastfm.plugin) -> No session key, not scrobbling (need to grant Ampache to last.fm)
2022-05-07T02:08:48-05:00 [user] (play/index) -> Stream ended at 2533817 (2533817) bytes out of 2533817
2022-05-07T02:08:51-05:00 [] (Ampache\Module\System\Dba) -> Database connection...
2022-05-07T02:08:51-05:00 [user] (Ampache\Module\System\Session) -> Session created: 5e0e155778e4d6a5d86452d7a41eaf01
2022-05-07T02:08:51-05:00 [user] (Ampache\Module\Api\Subsonic_Api) -> Stream proxy: https://example.com:443/play/index.php?ssid=5e0e155778e4d6a5d86452d7a41eaf01&type=song&oid=1414&uid=1&client=Sublime%20Music&action=download&cache=1&player=api&name=Blue123%20-%20Caged%20Heart.mp3
2022-05-07T02:08:51-05:00 [] (Ampache\Module\System\Dba) -> Database connection...
2022-05-07T02:08:52-05:00 [] (Ampache\Module\Application\ApplicationRunner) -> Found handler "Ampache\Module\Application\Playback\PlayAction" for action "play"
2022-05-07T02:08:52-05:00 [] (play/index) -> record_stats disabled: cache {song}
2022-05-07T02:08:52-05:00 [] (play/index) -> Asked for type {song}
2022-05-07T02:08:52-05:00 [user] (Ampache\Module\System\Session) -> 5e0e155778e4d6a5d86452d7a41eaf01 has been extended to Sat, 07 May 2022 04:08:52 -0500 extension length 7200
2022-05-07T02:08:52-05:00 [user] (Ampache\Repository\Model\User) -> Login from IP address: xxx.xxx.xxx.xxx
2022-05-07T02:08:52-05:00 [user] (play/index) -> download file (/musicpath/Katawa Shoujo Enigmatic Box of Sound/1-04 Caged Heart.mp3}...
2022-05-07T02:08:52-05:00 [user] (play/index) -> Media type {mp3}
2022-05-07T02:08:52-05:00 [user] (play/index) -> Stream ended at 2533817 (2533817) bytes out of 2533817
lusum commented 2 years ago

Duplicate of #3251, the bug is already fixed in develop

already-used-name commented 2 years ago

Duplicate of #3251, the bug is already fixed in develop

That issue is about the order of tracks within multidisc albums, this one is about repeated multidisc albums in Subsonic clients (sorry if I didn't phrase it right at first). I also tried the develop branch today and I doesn't fix the issue.

To try to explain it better here's a screenshot of DSub with a 3 disc album, it shows as 3 albums with the same name. Screenshot_20220507-192326

And here is a screenshot of DSub using navidrome/airsonic displaying the same album correctly. Screenshot_20220507-192338

lachlan-00 commented 2 years ago

if you have album_group on, these might be hidden by the sql in the ui and you might not have noticed them.

first up from the artist page do an update from tags and it will update the albums and either combine/delete the dupes.

if they still exist do they all have songs in them?

already-used-name commented 2 years ago

Setting album_group to off and updating from tags shows the album labeled by disc correctly on the web ui, but accessing any of these discs shows the whole list of tracks, rather than the disc's tracks (basically same issue as DSub, but I was unaware it also happened in the web ui).

Screenshot from 2022-05-10 01-21-47

Screenshot from 2022-05-10 01-23-02

Is this the intended behavior? One would think that each disc would show only it's respective tracks (for example, [Disk 3] in the screenshots should show only 2 tracks instead of 46).

lachlan-00 commented 2 years ago

no that shouldn't happen and grouping doesn't need to update from tags to un-group i'll look tomorrow morning and see why.

lachlan-00 commented 2 years ago

i can see the issues same as you. will be easy to fix, its getting the suite but not respeting the preferences.

lachlan-00 commented 2 years ago

before the suite was never set for non-group but now ampache always creates the suite

in 245db58a0 we just check the pref instead

arno1979 commented 2 years ago

Interesting topic! I can follow the discussion, implemented the changes from 245db58 and the WebUI is behaving as expected now. But in DSub I still have the problem: with album_group set to "off" for multi disc albums I get two entries (i.e. Disc 1 + Disc 2) but when clicking on either one of them I get a tracklisting for the complete set. I would love to be able to access single discs from a multi-disc set with individual tracklistings in DSub just as it is possible in the WebUI now. Am I missing something or is this another bug?

lachlan-00 commented 2 years ago

that's good, will look at that, it's probably using another situation of ignoring the group.

lachlan-00 commented 2 years ago

fixed with 93f2b1942 it was always getting the group.

The reason this is happening in places we haven't noticed is that the album_suite parameter used to be null if not grouped but now it's set all the time for other features

Let me know if you see anymore around

arno1979 commented 2 years ago

Look pretty good! The only thing I noticed is that on my android device some double albums which where permanently cached before have now disappeared from the cache. When looking at the filesystem on the SD card I can see that the folders for the albums are still there but they are empty. This does not happen for all double albums, I checked. I think it maybe has to with how the subfolders of each disc are named in the source folder on my server. But that's just a theory.

lachlan-00 commented 2 years ago

i think the perm, cache for dsub is based on the filename of the song in the api response.

so for a random song saved in dsub i see the path matches the path in my xml response path="Lucius/(2009) Songs From the Bromley House [[none]]/1-06 - 8 Birds.mp3

arno1979 commented 2 years ago

I don't really know about the DSub file naming pattern. I have other problems with that as well. It's not that big a problem and has more to do with DSub I think.

already-used-name commented 2 years ago

before the suite was never set for non-group but now ampache always creates the suite

in 245db58 we just check the pref instead

This fixes the issue with tracks in the web ui, but accessing a disc only shows the name of the album without disc number.

For example this is disc 3, tracks are displayed correctly, but no mention of which disc it is. Screenshot from 2022-05-12

fixed with 93f2b19 it was always getting the group.

The reason this is happening in places we haven't noticed is that the album_suite parameter used to be null if not grouped but now it's set all the time for other features

Let me know if you see anymore around

With this multiple discs are displayed correctly in clients like Subtracks, Ultrasonic and Sublime Music, but for some reason the issue persists in DSub so it may be an issue with that client itself.

Screenshot_20220512

Also, the issue of repeated discs with full tracklist remains if album_group is set back to on (tested with Subtracks and Ultrasonic since the setting seems to not have effect in DSub)

lachlan-00 commented 2 years ago

play album ignores the single disk and groups them all together?

the title i'll fix up tomorrow

arno1979 commented 2 years ago

In regards to:

since the setting seems to not have effect in DSub

and

play album ignores the single disk and groups them all together?

In my case (using DSub) the setting works and it doesn't group the albums togethers anymore if 'album_group' is set to 'off'. In my case I had make sure though that the option 'album_group' is set to off both under 'Preferences > Interface' and 'Admin > Interface'. I guess because the access level for this option is set to 'user'. My best guess is that the client (in my case Dsub) takes its information from the settings set in the 'Preferences' section as these seem to be the user specific settings.

already-used-name commented 2 years ago

Sorry, I needed to enable 'Browse by tags' in DSub, now albums/discs/tracks are displayed correctly with album_group off.

The issue remains with album_group set to on though.