The Clear Media Database action in the settings (Settings > Advanced) is useful because it clears all the medialibrary, keeping all the settings defined by the user.
But :
No information is displayed to the user to confirm the success
you have to restart the app manually and no default folders are selected for the medialibrary so that can be confusing for users
Expected behavior
After the action, we should restart the app and launch the on-boarding.
Moreover, we should have a direct access to this Android Clear Data view, as we had some time ago :
This is available from the Android Info app view but it's sometimes hard for a user to access it, depending of your Android Retailer version (it's very hard with a huawei phone for example)
Designs
Child items
0
No child items are currently assigned. Use child items to break down this issue into smaller parts.
Linked items
0
Link issues together to show that they're related.
Learn more.
I thought that onboarding was the easiest way to select the default foders, that's why I suggested this.
I'm not convinced about opening the media library folders, because it's intimidating for most of the people : they will probably select all Internal Device or will be afraid of doing anything...
A alternative could be open Media library folders WITH the default folders already selected.
But maybe there is still an issue with external devices ? (SD card...)
Maybe thumbnails cache should also be cleared ?
it may be almost fine after rescan when thumbnails files have media name, but when it's an id.jpg, if it's not the same id, thumbnails are all wrong.
Also when a media is removed from the db (either delete from the app or media not there anymore when scanning), thumbnails files are kept. maybe there should be a cleanup of thumbnails files not in the db anymore after a scan ?
Also when a media is removed from the db (either delete from the app or media not there anymore when scanning), thumbnails files are kept. maybe there should be a cleanup of thumbnails files not in the db anymore after a scan ?
If you have reproduction steps, it would be nice to create a new issue. The medialibrary should already delete the unnecessary thumbnails.
Just tested again, it doesn't delete anything, maybe i'm doing something wrong ?
put an mp4 in the folder, a jpg is generated in medialib/thumbnails after scan
remove the file from the folder, scan, the video is not visible in vlc => jpg is still there
put the mp4 again, it reappear in vlc, delete it from inside vlc => jpg is still there
maybe because the folder in on the sdcard, not in internal memory ?
PS: i just discovered that some are generated in medialib/thumbnails/.jpg, some other are in medialib/.jpg. even if they are episodes of the same show (so similar encoding and everything).
Generating/deleting the thumbnails is delegated to the medialibrary. As you saw, some thumbs are under /medialib (named with a filename) others under /medialib/thumbnails (named with an id). The first kind is because when looking for a video thumbnail, we first ask Android to get a thumb and, if we find one, we don't ask for it to the medialibrary. It allows VLC for Android to have less black thumbs that other ports.
I tested the deletion as well and it works great... for thumbs generated by the medialibrary: if the media is removed from indexed folders or the file is deleted, the thumb file is removed.
However, it doesn't work for thumbs generated by the app it self. I'll take a look.
Given the desire to be able to use the Clear Data and Clear Cache buttons, wouldn't it be preferable to pass the Context.getCacheDir() to libVLC? I suppose it could be equivalent to passing /data/user/0/org.videolan.vlc.debug/ as HOME and appending cache? (It's probably a best-practice to use the API instead of reconstructing the path to the cache, but is certainly more work at this point.) Ultimately, I think the objective should be to relocate /data/user/0/org.videolan.vlc.debug/app_vlc/.cache/art/ to /data/user/0/org.videolan.vlc.debug/cache/libvlc/art to match the Android directory structure.