mirror of
https://github.com/advplyr/audiobookshelf-app.git
synced 2025-08-03 09:34:51 +02:00
Fix:Sony xperia cover art in notification crash temp workaround #94
This commit is contained in:
parent
cdcf152049
commit
6157b5923a
1 changed files with 4 additions and 15 deletions
|
@ -672,6 +672,7 @@ class PlayerNotificationService : MediaBrowserServiceCompat() {
|
|||
}
|
||||
|
||||
// Issue with onenote plus crashing when using local cover art. https://github.com/advplyr/audiobookshelf-app/issues/35
|
||||
// Same issue with sony xperia https://github.com/advplyr/audiobookshelf-app/issues/94
|
||||
if (currentAudiobookStreamData?.coverUri != null && currentAudiobookStreamData?.isLocal == true) {
|
||||
var deviceName = Build.DEVICE
|
||||
var deviceMan = Build.MANUFACTURER
|
||||
|
@ -680,22 +681,10 @@ class PlayerNotificationService : MediaBrowserServiceCompat() {
|
|||
if (deviceMan.toLowerCase().contains("oneplus") || deviceName.toLowerCase().contains("oneplus")) {
|
||||
Log.d(tag, "Detected OnePlus device - removing local cover")
|
||||
currentAudiobookStreamData?.clearCover()
|
||||
} else if (deviceName.toLowerCase().contains("xperia") || deviceModel.toLowerCase().contains("xperia")) {
|
||||
Log.d(tag, "Detected Sony Xperia device - removing local cover")
|
||||
currentAudiobookStreamData?.clearCover()
|
||||
}
|
||||
|
||||
// OnePlus devices were showing valid permissions for image
|
||||
// try {
|
||||
// Log.d(tag, "CHECKING COVER ${currentAudiobookStreamData?.coverUri}")
|
||||
// var file = DocumentFile.fromTreeUri(ctx, currentAudiobookStreamData!!.coverUri)
|
||||
// Log.d(tag, "GOT FILE ${file?.name} | ${file?.type} | Can Read: ${file?.canRead()} |isExternalStorageDocument: ${file?.isExternalStorageDocument}")
|
||||
// if (file?.canRead() !== true) {
|
||||
// Log.d(tag, "Invalid cover: no read access")
|
||||
// currentAudiobookStreamData?.clearCover()
|
||||
// }
|
||||
// } catch(e:Exception) {
|
||||
// Log.d(tag, "Invalid cover: Failed to read local cover file $e")
|
||||
// currentAudiobookStreamData?.clearCover()
|
||||
// e.printStackTrace()
|
||||
// }
|
||||
}
|
||||
|
||||
var metadata = currentAudiobookStreamData!!.getMediaMetadataCompat()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue