mirror of
https://github.com/austinried/subtracks.git
synced 2026-11-11 07:29:14 +01:00
show album disc titles instead of generic disc numbers
Navidrome and gonic expose OpenSubsonic discTitles on the album response. Parse them into a transient Album.discTitles map and persist each album's titles in a child discs table (sourceId, albumId, disc, title) cascading from albums. Songs keep only their disc number, and the album screen joins by disc to render a title when one exists, falling back to "Disc N". Titles are read opportunistically: a server that doesn't send discTitles just leaves the table empty, so no API version negotiation is needed. Titles apply to single- and multi-disc albums, are pruned when removed, and are stored per album. Schema 10 -> 11.
This commit is contained in:
@@ -4,6 +4,7 @@ import androidx.lifecycle.ViewModel
|
||||
import androidx.lifecycle.viewModelScope
|
||||
import com.subtracks.data.model.Album
|
||||
import com.subtracks.data.model.CoverArtRef
|
||||
import com.subtracks.data.model.Disc
|
||||
import com.subtracks.data.model.Song
|
||||
import com.subtracks.data.repo.LibraryRepository
|
||||
import com.subtracks.data.repo.SourceRepository
|
||||
@@ -28,6 +29,8 @@ class AlbumDetailViewModel(
|
||||
|
||||
val songs: Flow<List<Song>> = sourceId.flatMapLatest { libraryRepository.albumSongs(it, albumId) }
|
||||
|
||||
val discs: Flow<List<Disc>> = sourceId.flatMapLatest { libraryRepository.albumDiscs(it, albumId) }
|
||||
|
||||
fun coverArt(
|
||||
coverArt: String?,
|
||||
thumbnail: Boolean,
|
||||
|
||||
Reference in New Issue
Block a user