vanilla-music / vanilla

Vanilla Music Player for Android
GNU General Public License v3.0
1.18k stars 295 forks source link

Setting `/storage/emulated/0` to neutral but a folder inside to `included` for scanning won't scan anything #902

Open ghost opened 5 years ago

ghost commented 5 years ago

Description

Setting /storage/emulated/0 to neutral but a folder inside to included for scanning won't scan anything, which makes just scanning one specific folder a bit of a hassle (I need to blacklist all others manually)

Steps to reproduce the issue

  1. On first vanilla launch, abort initial scan
  2. Set all scan paths to neutral including /storage/emulated/0 (which is initially set to be included) and hit Save
  3. Set only a subfolder, e.g. /storage/emulated/0/Music to included
  4. Restart scan

I would expect that to scan & show the contents of the Music folder, but from that point nothing new shows up (until I actually set /storage/emulated/0 back to included and then all non-/storage/emulated/0/Music subfolders manually to excluded)

adrian-bl commented 5 years ago

Just tested this on my device and it works as expected.

Can you provide a logcat?

adrian-bl commented 5 years ago

closing due to lack of feedback.

ghost commented 5 years ago

If you're interested in a logcat, a grep term might be helpful since this ROM has a pretty annoyingly spammy logcat that seems to log even key presses and network packets, so for privacy reasons it is a bit headach-y to pass around.

However, let me also note this happens to me 100% of the time from a clean install, I just tried it again, so if it didn't happen on other devices that'd be a very curious interaction! Let me repeat the steps in full detail:

  1. [Get clean state] Go into settings > All apps > Vanilla Music and press "Force Stop", confirm, press "Storage", press "Clear Data" in the submenu, "Confirm"

  2. Open Vanilla Music from your launcher or similar

  3. Click "OK" for "Vanilla Music needs read permissions to display your music library" dialog, and confirm "Allow" if needed

  4. Immediately, click corner menu button > "Settings" > "Media Library", scroll down and press "Cancel". (It is somewhat required for reproduction that the scan hasn't finished yet at this point, otherwise you can't tell later that the rescan doesn't add the additional missing things)

  5. Still in "Media Library", scroll up and press "edit". Press "OK" on "Scanner options changed" if that info dialog should pop up.

  6. You should now see a folder picker of your SD Card. Go one directory UP, long press green SD Card folder, press "Neutral" (it should turn gray).

  7. Descend back into SD Card folder, long press Android-default "Music" folder (which should be gray) and choose "Include" (it should turn green). Now leave the scan folder dialog with "Save".

  8. You should be back on the "Media Library" screen. Now, check the "Scan full filesystem (slower)" option - it should have been disabled up to now. Only then, press "Start scan" (for me it didn't automatically restart any scan before this point, so this was required)

  9. Use the back arrow button in the corner until you get back to the main album/artists/... screen

You should now have some albums/artists from the very initial quickly aborted scan (pretty much as far as that one got), and the new scan that is running now for me always fails to actually add anything, so from this point on the scanning just doesn't work

ghost commented 5 years ago

Do you need anything else than vanilla music's own entries in the logcat? (like the AudioTrack entries or something like that) Also it would be useful & interesting to know if anyone else can reproduce this

adrian-bl commented 5 years ago

Doing a grep for "VanillaMusic" should be sufficient

ghost commented 5 years ago

Okay I checked this more deeply after sending you the log and even ran it twice, and I observed that:

  1. The initial aborted scan does add items to the library instantly
  2. The one with /storage/emulated/0 set neutral and full filesystem enabled afterwards does not, however it will add them very late (like, many many minutes later!)

So it seems it's not fully broken, just has an unexpected really, really long delay before any of the items actually show up. Is that in some way intended? It would be nice & less confusing if it wasn't behaving like that. (Please note I hadn't ever checked flush media database for any of these scans, where this behavior would be less unexpected)

adrian-bl commented 5 years ago

Hmm.. maybe we are missing an adapter change notification somewhere:

The scanning progress tells the adapter (the library you see) about changes: if this doesn't happen for some reason, the adapter will use old information for some time.