DJDoubleD / QobuzDownloaderX-MOD

Downloads streams directly from Qobuz. Experimental refactoring of QobuzDownloaderX by AiiR
GNU General Public License v3.0
406 stars 14 forks source link

[Bug] Search doesn't display all results?? #76

Closed orbittwz closed 4 months ago

orbittwz commented 4 months ago

When searching for an album, the search results sometimes is not complete and it doesn't display all the results. For example: searching for "Tove Lo Sunshine Kitty paw prints edition", should give both 16 and 24 bit results, but only 16 bit result is displayed. the confirm is here: https://www.qobuz.com/us-en/search?q=Tove+Lo+Sunshine+Kitty+paw

proof: image

can you check why it's not displaying all results? quickly checking myself, maybe it's because the album link is without the "edition" part?? it's messing the parsing of the results somehow? the link is https://www.qobuz.com/us-en/album/sunshine-kitty-tove-lo/jip3fpq9vk1ra btw... the words "paw prints edition" don't appear in the link and maybe that's the reason?? thanks

DJDoubleD commented 4 months ago

I've looked into this and it's not a bug, these are just the results that are returned by the official Qobuz API... QBDLX-MOD uses the same API's as the official Qobuz mobile app and web player and I've tried your search query in both apps. Both of them give the exact same results, ignoring the 24 bit version of the "Paw Prints Edition" in an unfiltered seach:

https://www.qobuz.com/us-en/search?q=Tove+Lo+Sunshine+Kitty+paw

I have no idea why the API doesn't return this album, even though it is available for streaming. Unfortunately it's not possible to recreate the Qobuz Store search results.

I did notice something interesting that will solve your problem though. In the web player, there is an option to filter the search results for "HiRes" & "New Releases". When you apply the HiRes filter to your search query in the web player, the HiRes version of the Paw Prints Edition suddenly does show up. You can also apply this filter in the QBDLX-MOD search feature by simply adding #HiRes at the end of your query. So this query: Tove Lo Sunshine Kitty paw #HiRes will return these results:

Tove Lo Sunshine Kitty paw #HiRes

Bonus trick, to apply the "New Releases" filter to a search, you can also add #NewRelease to the end of the search query and both filters can be used together and/or separate.

orbittwz commented 4 months ago

Wow that's amazing to find... But it's awkward to use, since if for example an album is available only in 16bit, I won't see any results, thinking the album is not available. Is it possible to change the search handling at your QobuzApiSharp api, and when searching, the api will return the results for both queries with and without #HiRes tag?

orbittwz commented 4 months ago

you can even change the program code, and insert IF statement to the search function, if the user writes #HiRes in the string then do 2 searches, one with one without and save both and display the results.

orbittwz commented 4 months ago

my guess is changing SearchForm.cs if (searchTypeSelect.Text == "Album") { SearchResult albumsResult = QobuzApiServiceManager.GetApiService().SearchAlbums(searchQuery, 15, 0, true); Fill_AlbumResultsTablePanel(albumsResult); } else if (searchTypeSelect.Text == "Track") { SearchResult tracksResult = QobuzApiServiceManager.GetApiService().SearchTracks(searchQuery, 15, 0, true); Fill_TrackResultsTablePanel(tracksResult); }

should be changed to if (searchQuery.Contains("#HiRes) then do something and chain two search results, and then FILL to the panel. if (searchTypeSelect.Text == "Album") { SearchResult albumsResult = QobuzApiServiceManager.GetApiService().SearchAlbums(searchQuery, 15, 0, true); Fill_AlbumResultsTablePanel(albumsResult); } else if (searchTypeSelect.Text == "Track") { SearchResult tracksResult = QobuzApiServiceManager.GetApiService().SearchTracks(searchQuery, 15, 0, true); Fill_TrackResultsTablePanel(tracksResult); }

orbittwz commented 4 months ago

@DJDoubleD

orbittwz commented 4 months ago

scratch that, do the default search with #HiRes also... i.e when searchQuery is without #HiRes tag, do two search queries with and without and display all the results. if the tag #HiRes is in the searchQuery, do only one search with and display the results.

DJDoubleD commented 4 months ago

The application currently offers the same functionality as the Qobuz official app. At most I might at some point add checkboxes for the filters, but that's a very low priority since adding the hashtags to the search query is a very useable workaround.

I feel like this is a clear bug in the global search functionality of the Qobuz official API and they should fix this themselves. If I do a convoluted change to make 1 query do multiple searches and combine the results, it will considerably slow down the search functionality and there might be doubles in the results when Qobuz finally fixes their global search. (And even if I account for possible doubles and filter them out, it remains a very inefficient method)

In fact, I have already reported the issue to the Qobuz support bot. @orbittwz I suggest you also report this bug to Qobuz either via the support bot on their site or via support-help@qobuz.com. If they receive multiple reports, they might be more inclined to fix it...

For reference, this is the message I sent them:

Why does the web player's (and mobile app's) global search for the string "Sunshine Kitty (Paw Prints Edition)" not return the 24bit version of the album (https://play.qobuz.com/album/jip3fpq9vk1ra), while enabling the HiRes filter does show this version? I would expect that the global search returns all matches and that the HiRes filter just filters out the HiRes results...

orbittwz commented 4 months ago

I see, thanks for the quick answer man! In fact, this is very nice... you did a clever job with the program. I will email qobuz about this issue. You are correct doing two searches will yield some dupe results, nothing a simple string.Contains on the Item ID wouldn't solve, but I guess you don't want to expand something that may be fixed by them. In any case, wishing you the best and thanks for everything and this wonderful program!