aleksey-saenko / MusicRecognizer

An Android application for music recognition that uses AudD and ACRCloud services to perform song identification.
GNU General Public License v3.0
316 stars 8 forks source link

Add Wikipedia / Google / DuckDuckGo? #37

Closed C-O-D closed 5 months ago

C-O-D commented 6 months ago

Hi @aleksey-saenko, since this also works so well with YouTube and TIDAL, I just had the idea that it would be great if a Wikipedia and Google / DuckDuckGo search were also available. Since I research unknown artists quite often, it would be very convenient to be able to go directly to the Wikipedia page for the artist or even the album. If there are no entries there, you would then have the normal search function via Google or DuckDuckGo etc. What do you think?

Best regards

aleksey-saenko commented 6 months ago

Hey @C-O-D, I find these features quite useful. We could add a button for web search using the default browser and default search engine. This eliminates the need to create buttons for each new search engine and instead relies on the default one on the device. This could result in opening Firefox with DuckDuckGo, for example, if the user has such settings on the device. Or any other combinations.

Creating a direct link to a Wikipedia page for the track can be challenging as it is difficult to determine the exact URL of the desired page. On the other hand, creating a button that leads to a Wikipedia search query is relatively simple.

As always, I have doubts about where to place all of this in the interface. This row with endless links is confusing for me. Something to think about, thanks for the suggestions.

C-O-D commented 6 months ago

Hello @aleksey-saenko, I actually also meant a Google or DuckDuckGo search in the default browser. As far as Wikipedia is concerned, a simple search query would also work for me so that the app or browser opens automatically. Of course, it would be best if you had the option of searching for artists and albums separately or together. This might be necessary in some situations and might also increase the hit rate, sometimes names are spelled differently and so on... but I don't want to take this to the extreme :-) Maybe it would also be an idea to provide custom buttons where everyone can enter their own special search term? Could save some effort in the future. As far as the space is concerned, I was wondering why you didn't switch to the second row anyway, I would still have plenty of space (and I would also find it prettier) instead of having all providers in one row and having to scroll. Once again many greetings and above all an extra thank you for this already super good app.

aleksey-saenko commented 6 months ago

Added in version 1.2.1. The buttons are a bit hidden, but I hope to fix this in a future redesign of track screen. Wikipedia search works according to the selected language on the device. But generally, it works better in English because there are more articles in this language. In some cases, for popular tracks and artists, instead of searching, Wikipedia will immediately redirect to the article.

C-O-D commented 6 months ago

Hello @aleksey-saenko, sorry for my late feedback and thanks for the implementation. I now have the problem with the web search that my default browser is not shown as an option, which is very strange. I only get my two alternative browsers and Google as options to open, but not Kiwi browser. As for the Wikipedia search, could you possibly change the query to just wikipedia.org without a country default? Then the Wikipedia app would feel addressed. If the query goes to de.wikipedia.org, as in my case, the URL is always opened in the browser and I don't even have the chance to use the app...

Best regards

aleksey-saenko commented 6 months ago

Actually, wiki app intercepts the link regardless of the locale. If you observe closely, you can see wiki briefly opening before the browser. However, the app recognizes Special:Search option in the link and for some reason redirects it to the browser. To perform the search directly in the app, we need to pass the query specifically to wiki app package, rather than the entire URL. I didn't take this into account, but I'll fix it in future releases, thanks for feedback.

The issue with browser support is more complex. Here's how it works: I create an intent with the action WEB_SEARCH or SEARCH, and Android searches for all apps capable of handling this intent. The browser must declare support for this feature (for example, Firefox). However, in Kiwi sources, I couldn't find any mention of WEB_SEARCH, and the default category for SEARCH is not specified. This doesn't allow to implicitly find this app to perform search.

It all depends on browser's support, as I see it. While there may be other potential solutions, I'm not aware of any at the moment. If you have come across any open-source app that implement a search function through the Kiwi browser (without hard coded search engine), please let me know.

C-O-D commented 6 months ago

To be honest, I actually use an app that allows me to open links in different browsers / apps (https://github.com/TrianguloY/UrlChecker). However, it doesn't respond to your search queries either, which is also unusual as it is defined as the default browser and always intercepts everything else. This app is absolutely vital for me as otherwise I'm not able to watch youtube videos with other apps apart from the standard youtube app. Sorry for all the trouble but it would be great if you could find a solution and thank you for taking care of the wikipedia problem.

aleksey-saenko commented 5 months ago

Search redirecting to Wikipedia app was fixed in new version 1.2.3.

C-O-D commented 5 months ago

Search redirecting to Wikipedia app was fixed in new version 1.2.3.

Just noticed it and it works like a charm - thank you very much!