build: fix failure

Due to a sudden pivot to starting from repository backwards with
playlists, there were some half-baked changesets lying around that
I forgot to revert. Do that.
This commit is contained in:
Alexander Capehart 2023-03-19 20:04:18 -06:00
parent e4339a76bf
commit c6898aa3cc
No known key found for this signature in database
GPG key ID: 37DBE3621FE9AD47
4 changed files with 7 additions and 9 deletions

View file

@ -20,6 +20,7 @@ rather than on start/stop
- Fixed MP4-AAC files not playing due to an accidental audio extractor
deletion
- Fix "format" not appearing in song properties view
- Fix visual bugs when editing duplicate songs in the queue
## 3.0.3

View file

@ -144,11 +144,9 @@ interface Indexer {
*
* @param result The outcome of the music loading process.
*/
data class Complete(val result: Result<Response>) : State()
data class Complete(val result: Result<Library>) : State()
}
data class Response(val result: Library, val playlists: List<Playlist>)
/**
* Represents the current progress of the music loader. Usually encapsulated in a [State].
*
@ -239,7 +237,7 @@ constructor(
private val mediaStoreExtractor: MediaStoreExtractor,
private val tagExtractor: TagExtractor
) : Indexer {
@Volatile private var lastResponse: Result<Indexer.Response>? = null
@Volatile private var lastResponse: Result<Library>? = null
@Volatile private var indexingState: Indexer.Indexing? = null
@Volatile private var controller: Indexer.Controller? = null
@Volatile private var listener: Indexer.Listener? = null
@ -339,7 +337,7 @@ constructor(
context: Context,
withCache: Boolean,
scope: CoroutineScope
): Indexer.Response {
): Library {
if (ContextCompat.checkSelfPermission(context, Indexer.PERMISSION_READ_AUDIO) ==
PackageManager.PERMISSION_DENIED) {
logE("Permission check failed")
@ -397,7 +395,7 @@ constructor(
if (cache == null || cache.invalidated) {
cacheRepository.writeCache(rawSongs)
}
return Indexer.Response(libraryJob.await(), listOf())
return libraryJob.await()
}
/**
@ -428,7 +426,7 @@ constructor(
* @param result The new [Result] to emit, representing the outcome of the music loading
* process.
*/
private suspend fun emitCompletion(result: Result<Indexer.Response>) {
private suspend fun emitCompletion(result: Result<Library>) {
yield()
// Swap to the Main thread so that downstream callbacks don't crash from being on
// a background thread. Does not occur in emitIndexing due to efficiency reasons.

View file

@ -40,7 +40,7 @@ import org.oxycblt.auxio.playback.state.RepeatMode
entities = [PlaybackState::class, QueueHeapItem::class, QueueMappingItem::class],
version = 27,
exportSchema = false)
@TypeConverters(Music.UID.Converter::class)
@TypeConverters(PersistenceDatabase.Converters::class)
abstract class PersistenceDatabase : RoomDatabase() {
/**
* Get the current [PlaybackStateDao].

View file

@ -26,4 +26,3 @@ interface Playlist {
val name: String
val songs: List<Song>
}