LMS-Community / plugin-Qobuz

Squeebox plugin to stream from qobuz.com
31 stars 16 forks source link

Ensure tracks in the same work are grouped even if composer metadata is missing from some. #34

Closed SamInPgh closed 1 year ago

SamInPgh commented 1 year ago

For some reason, Qobuz does not populate the composer tag for classical tracks that are tagged as unavailable for streaming. This prevents them from being included in the 'work' object to which they belong in the plugin, which is keyed on composer and work. Instead, they are added to separate works, keyed on the work name only, which is confusing. Fortunately there are not a whole lot of releases containing these tracks, but enough to bother someone with a low threshold of annoyance such as myself. ;-) This change groups these tracks with the others in same work.

michaelherger commented 1 year ago

@darrell-k - feedback?

SamInPgh commented 1 year ago

Here's a screenshot from my "worst case" test album. As you probably know, the tracks with '*' are the non-streamable ones.

Screenshot_2023-04-27-01-26-18

darrell-k commented 1 year ago

Sorry managed to reply to previous message. See above.

darrell-k commented 1 year ago

The samples won't play for me even with the option enabled - maybe something in my server settings? Do those Chopin samples play for you?

Anyway, should we have a warning line at the very top of the list "this release contains some unstreamable tracks" (whatever the user pref is set to)?

SamInPgh commented 1 year ago

No, those samples don't play for me either and an error message is written to the server log. However, I tried a couple of other non-classical unstreamable tracks and the samples played correctly. I think it's a Qobuz problem. Because of this flaky behavior, I turned off the plugin option to play them so they won't be added to my player queue. I don't think it's worth adding a warning line though. Having the "*" before the track names should be enough for the user to figure it out. Also, there seem to be very few of these tracks, especially in the classical genre. I had a hard time finding even one other release besides that Chopin one.

darrell-k commented 1 year ago

I amended the plug-in to show the (hopefully) relevant metadata. See screenshot. The tracks in question on the Chopin release say streamable from today(!) but still streamable=no and sampleable=no. I cleared cache.db and Qobuz.db but that made no difference.

Have you an example of an album containing playable samples?

Screenshot 2023-04-28 13 27 27

SamInPgh commented 1 year ago

Interesting info. Unfortunately, I am having no luck finding other albums -- classical or not -- that contain non-streamable tracks. I will continue to search but they seem to be becoming rarer. I believe that Qobuz is trying to clean things up on their end. Apparently there have been many complaints from users about tracks in their saved playlists becoming unstreamable due to the albums being recatalogued with different track id's and they're attempting to address the situation.

darrell-k commented 1 year ago

Yes, I've had that problem with a few favourites - momentary panic but then searching and re-adding to favourites solved it. Since my last post, I've discovered that the streamable_at date is meaningless - some favourites I added ages ago have dates this year, and even within the last month.

SamInPgh commented 1 year ago

Okay. It took awhile but I managed to find another classical album with unstreamable tracks AND playable samples of those tracks:

Joseph Haydn: Die Schöpfung (La Création) qobuz:album:5413633582280

The three sample tracks are 30-second mp3's.

darrell-k commented 1 year ago

Thanks. the sampleable flag is set as we would expect. But the streamable_at date is empty, which our Slim::Utils::DateTime::shortDateF function returns as today (like every date function I've ever seen does when called with no argument).

Anyway, I vote your changes are merged ;)

Screenshot 2023-04-28 21 23 44

darrell-k commented 1 year ago

Oh, what did you think of my suggestion that we default the Enhanced Classical Display to enabled (to assist users who don't read the release notes)?

SamInPgh commented 1 year ago

Great. I have no problem with changing the default behavior. I believe that the default values are only used when installing the plugin for the first time (or reinstalling it), so it wouldn't affect existing users. How about we leave that decision to @michaelherger though?

michaelherger commented 1 year ago

Oops... my words of thanks went in to the commit message... so here again:

Thanks guys! I'll set the useClassicalEnhancements. As @SamInPgh mentioned this would only have an impact on users who haven't installed the plugin yet, or who have not touched the settings since the last update. I see that the value currently isn't initialized. So setting this now will enable it for many, I guess. But that's fine with me.

SamInPgh commented 1 year ago

@darrell-k I just re-read your last post and realized that I missed the opportunity to make use of the sampleable tag to prevent those tracks with it set to '0' from being added to the player queue even if the plugin option to play sample tracks is selected. I'm not sure if it's worth creating another pull request but let's keep it in mind to be rolled into the next update.