all: misc cleanup

Miscellanious cleanup in preparation for 3.0.1.
This commit is contained in:
Alexander Capehart 2023-01-03 18:45:12 -07:00
parent d8e24c4c47
commit 360dab928c
No known key found for this signature in database
GPG key ID: 37DBE3621FE9AD47
9 changed files with 20 additions and 17 deletions

View file

@ -17,6 +17,10 @@
#### What's Fixed
- Fixed mangled multi-value ID3v2 tags when UTF-16 is used
- Fixed crash when playing certain MP3 files
- Detail UI will no longer crash if the music library is unavailable
#### Dev/Meta
- Add CI workflow
## 3.0.0

View file

@ -21,5 +21,5 @@
#-renamesourcefileattribute SourceFile
# Obsfucation is what proprietary software does to keep the user unaware of it's abuses.
# Also it's easier to debug if the class names remain unmangled.
# Also it's easier to fix issues if the stack trace symbols remain unmangled.
-dontobfuscate

View file

@ -173,8 +173,8 @@ class DetailViewModel(application: Application) :
}
/**
* Set a new [currentSong] from it's [Music.UID]. If the [Music.UID] differs, a new loading
* process will begin and the newly-loaded [DetailSong] will be set to [currentSong].
* Set a new [currentSong] from it's [Music.UID]. If the [Music.UID] differs, [currentSong]
* and [songProperties] will be updated to align with the new [Song].
* @param uid The UID of the [Song] to load. Must be valid.
*/
fun setSongUid(uid: Music.UID) {
@ -231,7 +231,8 @@ class DetailViewModel(application: Application) :
private fun <T : Music> requireMusic(uid: Music.UID) = musicStore.library?.find<T>(uid)
/**
* Start a new job to load a [DetailSong] based on the properties of the given [Song]'s file.
* Start a new job to load a given [Song]'s [SongProperties]. Result is pushed to
* [songProperties].
* @param song The song to load.
*/
private fun loadProperties(song: Song) {

View file

@ -140,9 +140,12 @@ class Date private constructor(private val tokens: List<Int>) : Comparable<Date>
min.resolveDate(context)
}
override fun compareTo(other: Range): Int {
return min.compareTo(other.min)
}
override fun equals(other: Any?) =
other is Range && min == other.min && max == other.max
override fun hashCode() = 31 * max.hashCode() + min.hashCode()
override fun compareTo(other: Range) = min.compareTo(other.min)
companion object {
/**

View file

@ -416,7 +416,6 @@ class Indexer private constructor() {
/**
* Music loading has completed.
* @param result The outcome of the music loading process.
* @see Response
*/
data class Complete(val result: Result<MusicStore.Library>) : State()
}

View file

@ -72,6 +72,7 @@ class PlaybackStateManager private constructor() {
val queue
get() = _queue
/** The position of the currently playing item in the queue. */
@Volatile
var index = -1
private set
/** The current [InternalPlayer] state. */
@ -525,10 +526,9 @@ class PlaybackStateManager private constructor() {
* @param database The [PlaybackStateDatabase] to clear te state from
* @return If the state was cleared, false otherwise.
*/
suspend fun wipeState(database: PlaybackStateDatabase): Boolean {
suspend fun wipeState(database: PlaybackStateDatabase) =
try {
logD("Wiping state")
return try {
withContext(Dispatchers.IO) { database.write(null) }
true
} catch (e: Exception) {
@ -536,7 +536,6 @@ class PlaybackStateManager private constructor() {
logE(e.stackTraceToString())
false
}
}
/**
* Update the playback state to align with a new [MusicStore.Library].

View file

@ -128,12 +128,10 @@
<string name="fmt_lib_song_count">Canciones cargadas: %d</string>
<plurals name="fmt_song_count">
<item quantity="one">%d canción</item>
<item quantity="many">%d canciones</item>
<item quantity="other">%d canciones</item>
</plurals>
<plurals name="fmt_album_count">
<item quantity="one">%d álbum</item>
<item quantity="many">%d álbumes</item>
<item quantity="other">%d álbumes</item>
</plurals>
<string name="lbl_size">Tamaño</string>

View file

@ -1,2 +1,2 @@
<?xml version="1.0" encoding="utf-8"?>
<resources></resources>
<resources />

View file

@ -245,7 +245,6 @@
<string name="lbl_mix">Mix</string>
<plurals name="fmt_artist_count">
<item quantity="one">%d artista</item>
<item quantity="many">%d artistas</item>
<item quantity="other">%d artistas</item>
</plurals>
<string name="set_rescan">Re-escanear músicas</string>