The Medialibrary sometimes doesn't have the media's length,
and won't know that the file has ended.
For some files this causes a finished video to keep it's time and when
played again starts at the end, and leave the player.
This forces the ML to mark the file as finished and reset it's time
Instead of re-adding the default internal storage as an ML root, save
previous roots, reset the db, and re-add these roots.
This is !2080 but for TV as I forgot to also apply the changes to the tv
settings
Some filenames from opensubtitles.org had characters not authorized for an
Android Uri. This sanitizes the filename so it can be used as dest in copyFile
Cf https://www.rfc-editor.org/rfc/rfc2396 #2.4.3 mentionned in the Uri.parse
method doc
If for some reason the FileUtils.copyFile fails, the subtitleItem should
be removed from the ExternalSubDirectory's downloading items to change
the item's state back to NotDownloaded to stop the download progress
animation. Also nice to display a snackbar error for the user.
Files shared through file providers can be played natively using file
descriptors, meaning that they can be opened even though the VLC for
Android doesn't have any file access permissions given be the user.
In the case of the VideoGridFragment, canReadVideos will always return
true below API 33, showing media if there were media indexed before
revoking file permissions.
On android 11 an 12 (API 30/31/32) when media permission only,
isExternalStorageManager will return false, but checking for
READ_EXTERNAL_STORAGE will return true.
On Android API 33+, if given only audio or video permission,
READ_EXTERNAL_STORAGE will also return true meaning that the check must
be restrained to API 30/31/32,
Furthermore, for API 30/31/32, isExternalStorageManager also needs to be
checked for when the app has full access.
Fixes#3129
On a new install, the manageMediaPermsCheck onclicklistener will
ask for video/audio permission for API 33+, but for 30+ goes to
getStoragePermission which ends calling requestStorageAccess.
When API 30+ this will spawn a new PermissionListDialog, creating a
loop.
In the onClickListener, asking for READ_EXTERNAL_STORAGE straight away
for API 30+ solves this.
Revert of c49382e3. After some discussions, and user
complaints it was decided to go back to the old behavior and keep repeat
one enable when pressing next.
Most players do that. VLC for iOS also changed to this behavior