thibseisel / android-odeon

A simple but efficient music player on Android.
Apache License 2.0
69 stars 9 forks source link

[Feature] Search for tracks in a specific folder #14

Closed ghost closed 3 years ago

ghost commented 3 years ago

Hi, congratulations for the application. I recommend only one improvement: possibility to choose which folder/s to search for songs.

thibseisel commented 3 years ago

Hi @0xFEDERICO, Thanks for your feedback, it's much appreciated.

Regarding your feature request I don't (currently) know if Odeon could implement it. As of Android 10 there are more restrictions on how files on the device are read and written. This is a major change made to enhance privacy, and only apps that flag themselves as "file explorers" are granted rights to browse the whole file hierarchy. Therefore I no longer have a way to know exactly where a music file is located on the device ; I just know that it exists.

Please tell me more about why you need to restrict search results based on a file path. Do you need it because:

  1. you have multiple collections of songs on your device (for example yours and that of someone else that also uses your phone), and you want a clear separation between those?
  2. there are some music files that you are unable to find with Odeon, and you'd like the application to search in a specific folder?
  3. something else?
ghost commented 3 years ago

Thanks for the answer @thibseisel, the motivation is very simple: I use github.com/0xfederico/spotifai to download the music and put it in a folder in my home -> /storage/emulated/0/Music. The odeon app also shows me other files in audio format (which are not music) from my home and during playback it blocks me from listening. I had thought of making a playlist so that I could exclude these audios but it is not possible.

ghost commented 3 years ago

oops, putting songs in a playlist is possible. I thought you could do multiple selection. Problem solved, thanks for the support!

thibseisel commented 3 years ago

OK, now I see. Indeed you could create a separate playlist to list only tracks that you'd like to play. This makes me remember that the playlist feature is not really polished as we can't even reorder or remove tracks, but that's another story.

Odeon uses the facilities of the Android system to find music files. It is quite simple: if a music file is stored in /storage/emulated/0/Music (as opposed to Alarms, Notifications, Ringtones and Podcasts folders), then it is flagged as "Music" and will be listed by Odeon. One workaround would be to put excluded music files in another folder but that's not very handy.

Another solution I could implement is something like an "ignore list" (would have called it a "blacklist" but it's no longer an acceptable name anymore): tracks in that list would no longer be displayed on any screen or part of a playlist, as if those tracks were not on the device. That would cover the use case where we don't want to listen to a given track, but want to keep it on device for some reasons.

Tell me what you think about it.

ghost commented 3 years ago

I understand what you mean @thibseisel, the problem is that the audio tracks I am talking about are out of the /storage/emulated/0/Music folder, they are in sub folders of /storage/emulated/0/ like /storage/emulated/0/{baz,bar,foo} so the functionality of the android system is also looking for outside this Music folder... Adding a list of files to ignore seems like a good solution to me since the audio tracks are about 40 compared to 200+ of music.