diff --git a/app/src/main/java/org/oxycblt/auxio/music/Models.kt b/app/src/main/java/org/oxycblt/auxio/music/Models.kt index 8ad85377c..58f9fcab1 100644 --- a/app/src/main/java/org/oxycblt/auxio/music/Models.kt +++ b/app/src/main/java/org/oxycblt/auxio/music/Models.kt @@ -47,12 +47,12 @@ sealed class Parent : BaseModel() { * @property hash A versatile, unique(ish) hash used for databases */ data class Song( - override val id: Long = -1, + override val id: Long, override val name: String, val fileName: String, - val albumId: Long = -1, - val track: Int = -1, - val duration: Long = 0 + val albumId: Long, + val track: Int, + val duration: Long ) : BaseModel() { private var mAlbum: Album? = null private var mGenre: Genre? = null @@ -95,11 +95,11 @@ data class Song( * @property totalDuration The combined duration of all of the album's child songs, formatted. */ data class Album( - override val id: Long = -1, + override val id: Long, override val name: String, val artistName: String, - val coverUri: Uri = Uri.EMPTY, - val year: Int = 0 + val coverUri: Uri, + val year: Int ) : Parent() { private var mArtist: Artist? = null val artist: Artist get() = requireNotNull(mArtist) @@ -138,7 +138,7 @@ data class Album( * @property songs The list of all [Song]s in this artist */ data class Artist( - override val id: Long = -1, + override val id: Long, override val name: String, val albums: List ) : Parent() { @@ -167,7 +167,7 @@ data class Artist( * @property resolvedName A name that has been resolved from its int-genre form to its named form. */ data class Genre( - override val id: Long = -1, + override val id: Long, override val name: String, ) : Parent() { private val mSongs = mutableListOf() @@ -191,8 +191,8 @@ data class Genre( * A data object used solely for the "Header" UI element. Inherits [BaseModel]. */ data class Header( - override val id: Long = -1, - override val name: String = "", + override val id: Long, + override val name: String, ) : BaseModel() /** @@ -201,8 +201,8 @@ data class Header( * @property action The callback that will be called when the action button is clicked. */ data class ActionHeader( - override val id: Long = -1, - override val name: String = "", + override val id: Long, + override val name: String, @DrawableRes val icon: Int, val action: () -> Unit, ) : BaseModel() diff --git a/app/src/main/java/org/oxycblt/auxio/music/MusicLoader.kt b/app/src/main/java/org/oxycblt/auxio/music/MusicLoader.kt index a65ff62af..2b925824c 100644 --- a/app/src/main/java/org/oxycblt/auxio/music/MusicLoader.kt +++ b/app/src/main/java/org/oxycblt/auxio/music/MusicLoader.kt @@ -2,6 +2,7 @@ package org.oxycblt.auxio.music import android.annotation.SuppressLint import android.content.Context +import android.net.Uri import android.provider.MediaStore import android.provider.MediaStore.Audio.Albums import android.provider.MediaStore.Audio.Genres @@ -188,8 +189,11 @@ class MusicLoader(private val context: Context) { // Group up songs by their album ids and then link them with their albums val songsByAlbum = songs.groupBy { it.albumId } val unknownAlbum = Album( + id = -1, name = context.getString(R.string.placeholder_album), - artistName = context.getString(R.string.placeholder_artist) + artistName = context.getString(R.string.placeholder_artist), + coverUri = Uri.EMPTY, + year = 0 ) songsByAlbum.forEach { entry -> @@ -266,7 +270,10 @@ class MusicLoader(private val context: Context) { val songsWithoutGenres = songs.filter { it.genre == null } if (songsWithoutGenres.isNotEmpty()) { - val unknownGenre = Genre(name = context.getString(R.string.placeholder_genre)) + val unknownGenre = Genre( + id = -2, + name = context.getString(R.string.placeholder_genre) + ) songsWithoutGenres.forEach { song -> unknownGenre.linkSong(song) diff --git a/app/src/main/res/font/inter_exbold.ttf b/app/src/main/res/font/inter_exbold.ttf deleted file mode 100644 index 7f16a0f0f..000000000 Binary files a/app/src/main/res/font/inter_exbold.ttf and /dev/null differ diff --git a/app/src/main/res/values/dimens.xml b/app/src/main/res/values/dimens.xml index 93f6e6c54..4b7edac4f 100644 --- a/app/src/main/res/values/dimens.xml +++ b/app/src/main/res/values/dimens.xml @@ -41,7 +41,7 @@ 10sp - 2sp + 1sp 20sp 26sp 18sp diff --git a/app/src/main/res/values/styles.xml b/app/src/main/res/values/styles.xml index 580cd2c9f..d87d155a2 100644 --- a/app/src/main/res/values/styles.xml +++ b/app/src/main/res/values/styles.xml @@ -59,7 +59,7 @@ @@ -67,11 +67,12 @@ diff --git a/info/FORMATS.md b/info/FORMATS.md index 89ab08def..2d9cf8f7f 100644 --- a/info/FORMATS.md +++ b/info/FORMATS.md @@ -6,7 +6,7 @@ Here are the music formats that Auxio supports, as per the [Supported ExoPlayer ✅ = Supported -❌ = Not supported +👎 = Not supported well | Format | Supported | Comments | |--------|-----------|----------- @@ -17,4 +17,4 @@ Here are the music formats that Auxio supports, as per the [Supported ExoPlayer | WAV | ✅ | | | MPEG | ✅ | | | AAC | ✅ | | -| FLAC | ❌ | Auxio must be patched with the [FLAC Extension](https://github.com/google/ExoPlayer/tree/release-v2/extensions/flac). I do plan to roll this myself eventually, but it may take awhile | +| FLAC | 👎 | Supported on Android 8.1 or newer. Auxio must be patched with the [FLAC Extension](https://github.com/google/ExoPlayer/tree/release-v2/extensions/flac) on lower versions. |