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.
This commit is contained in:
OxygenCobalt
2022-06-11 16:30:01 -06:00
parent c95edfa28b
commit 47437c355d
2 changed files with 6 additions and 1 deletions
@@ -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"
}
}