From 47437c355dcd76ce5feb85d84bbbddb14aabb1e1 Mon Sep 17 00:00:00 2001 From: OxygenCobalt Date: Sat, 11 Jun 2022 16:28:09 -0600 Subject: [PATCH] music: eliminate odd songs with no size Remove malformed songs that have a size of 0 bytes, but are still present in MediaStore. This issue only seems to occur when files are transferred via MTP, but are not loaded due to storage issues. --- CHANGELOG.md | 3 +++ .../java/org/oxycblt/auxio/music/backend/MediaStoreBackend.kt | 4 +++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b9e7d6ecc..bdb55474d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,7 @@ ## dev [v2.3.2, v2.4.0, or v3.0.0] #### What's New +- Added a new view for song properties (Such as Bitrate) - Folders on external drives can now be excluded on Android Q+ [#134] - Playback bar now has a skip action - When playing, the cover now shows an animated indicator @@ -14,6 +15,8 @@ #### What's Fixed - Playback bar now picks the larger inset in case that gesture inset is missing [#149] +- Fixed unusable excluded directory UI +- Songs with no data (i.e size of 0) are now filtered out #### Dev/Meta - New translations [Fjuro -> Czech] diff --git a/app/src/main/java/org/oxycblt/auxio/music/backend/MediaStoreBackend.kt b/app/src/main/java/org/oxycblt/auxio/music/backend/MediaStoreBackend.kt index 717e158b0..b14867384 100644 --- a/app/src/main/java/org/oxycblt/auxio/music/backend/MediaStoreBackend.kt +++ b/app/src/main/java/org/oxycblt/auxio/music/backend/MediaStoreBackend.kt @@ -342,7 +342,9 @@ abstract class MediaStoreBackend : Indexer.Backend { * The base selector that works across all versions of android. Does not exclude * directories. */ - @JvmStatic protected val BASE_SELECTOR = "${MediaStore.Audio.Media.IS_MUSIC}=1" + @JvmStatic + protected val BASE_SELECTOR = + "${MediaStore.Audio.Media.IS_MUSIC}=1 AND NOT ${MediaStore.Audio.Media.SIZE}=0" } }