Start working on QuickPicks screen

This commit is contained in:
vfsfitvnm
2022-09-28 21:46:56 +02:00
parent 7a3c0ca110
commit 33778b33dd
37 changed files with 1354 additions and 272 deletions

View File

@@ -6,13 +6,13 @@ import it.vfsfitvnm.youtubemusic.YouTube
object YouTubeArtistSaver : Saver<YouTube.Item.Artist, List<Any?>> {
override fun SaverScope.save(value: YouTube.Item.Artist): List<Any?> = listOf(
with(YouTubeBrowseInfoSaver) { save(value.info) },
value.info?.let { with(YouTubeBrowseInfoSaver) { save(it) } },
value.subscribersCountText,
with(YouTubeThumbnailSaver) { value.thumbnail?.let { save(it) } }
)
override fun restore(value: List<Any?>) = YouTube.Item.Artist(
info = YouTubeBrowseInfoSaver.restore(value[0] as List<Any?>),
info = (value[0] as List<Any?>?)?.let(YouTubeBrowseInfoSaver::restore),
subscribersCountText = value[1] as String?,
thumbnail = (value[2] as List<Any?>?)?.let(YouTubeThumbnailSaver::restore)
)