music: handle null mediastore album name
Mostly a band-aid to make null album names correspond to a folder name (the standard MediaStore behavior).
This commit is contained in:
parent
294c558b93
commit
82a015c1e1
1 changed files with 4 additions and 1 deletions
|
@ -283,7 +283,10 @@ private class MediaStoreExtractorImpl(
|
||||||
// the file is not actually in the root internal storage directory. We can't do
|
// the file is not actually in the root internal storage directory. We can't do
|
||||||
// anything to fix this, really. We also can't really filter it out, since how can we
|
// anything to fix this, really. We also can't really filter it out, since how can we
|
||||||
// know when it corresponds to the folder and not, say, Low Roar's breakout album "0"?
|
// know when it corresponds to the folder and not, say, Low Roar's breakout album "0"?
|
||||||
rawSong.albumName = cursor.getString(albumIndex)
|
// Also, on some devices it's literally just null. To maintain behavior sanity just
|
||||||
|
// replicate the majority behavior described prior.
|
||||||
|
rawSong.albumName = cursor.getStringOrNull(albumIndex)
|
||||||
|
?: requireNotNull(rawSong.path?.name) { "Invalid raw: No path" }
|
||||||
// Android does not make a non-existent artist tag null, it instead fills it in
|
// Android does not make a non-existent artist tag null, it instead fills it in
|
||||||
// as <unknown>, which makes absolutely no sense given how other columns default
|
// as <unknown>, which makes absolutely no sense given how other columns default
|
||||||
// to null if they are not present. If this column is such, null it so that
|
// to null if they are not present. If this column is such, null it so that
|
||||||
|
|
Loading…
Reference in a new issue