From 7a2f4c2cabde69cf3670583ce7af4519853e6e3e Mon Sep 17 00:00:00 2001 From: Rino Russo Date: Mon, 24 Jun 2024 12:01:58 +0200 Subject: [PATCH] New release version 0.6.40.1 --- .../rimusic/ui/screens/album/AlbumScreen.kt | 10 ++++++---- .../innertube/models/v0624/BrowseResponse0624.kt | 14 +++++++------- .../it/fast4x/innertube/requests/AlbumPage.kt | 13 +++++++------ .../it/fast4x/innertube/requests/PlaylistPage.kt | 15 ++++++++------- 4 files changed, 28 insertions(+), 24 deletions(-) diff --git a/app/src/main/kotlin/it/fast4x/rimusic/ui/screens/album/AlbumScreen.kt b/app/src/main/kotlin/it/fast4x/rimusic/ui/screens/album/AlbumScreen.kt index 420e92aefb..5606c231a0 100644 --- a/app/src/main/kotlin/it/fast4x/rimusic/ui/screens/album/AlbumScreen.kt +++ b/app/src/main/kotlin/it/fast4x/rimusic/ui/screens/album/AlbumScreen.kt @@ -84,13 +84,13 @@ fun AlbumScreen( playerEssential: @Composable () -> Unit = {}, ) { - val uriHandler = LocalUriHandler.current + //val uriHandler = LocalUriHandler.current val saveableStateHolder = rememberSaveableStateHolder() var tabIndex by rememberSaveable { mutableStateOf(0) } - var thumbnailRoundness by rememberPreference( + val thumbnailRoundness by rememberPreference( thumbnailRoundnessKey, ThumbnailRoundness.Heavy ) @@ -109,13 +109,15 @@ fun AlbumScreen( Database .album(browseId) .combine(snapshotFlow { tabIndex }) { album, tabIndex -> album to tabIndex } - .collect { (currentAlbum, tabIndex) -> + .collect { (currentAlbum, + // tabIndex + ) -> album = currentAlbum if (albumPage == null //&& (currentAlbum?.timestamp == null || tabIndex == 1) ) { - //println("mediaItem home album launch start") + println("mediaItem home album launch start browseId $browseId") withContext(Dispatchers.IO) { Innertube.albumPage(BrowseBody(browseId = browseId)) ?.onSuccess { currentAlbumPage -> diff --git a/innertube/src/main/kotlin/it/fast4x/innertube/models/v0624/BrowseResponse0624.kt b/innertube/src/main/kotlin/it/fast4x/innertube/models/v0624/BrowseResponse0624.kt index 30ad8be44e..7d687c8307 100644 --- a/innertube/src/main/kotlin/it/fast4x/innertube/models/v0624/BrowseResponse0624.kt +++ b/innertube/src/main/kotlin/it/fast4x/innertube/models/v0624/BrowseResponse0624.kt @@ -86,12 +86,12 @@ data class MusicResponsiveListItemRenderer ( val overlay: Overlay, val flexColumns: List, val fixedColumns: List, - val menu: Menu, + val menu: Menu? = null, val badges: List? = null, - val playlistItemData: PlaylistItemData, + val playlistItemData: PlaylistItemData? = null, val itemHeight: ItemHeight, val index: Index, - val multiSelectCheckbox: MultiSelectCheckbox + val multiSelectCheckbox: MultiSelectCheckbox? = null ) @Serializable @@ -526,7 +526,7 @@ data class MusicItemThumbnailOverlayRendererContent ( @Serializable data class ContentMusicPlayButtonRenderer ( - val playNavigationEndpoint: NavigationEndpoint, + val playNavigationEndpoint: NavigationEndpoint? = null, val trackingParams: String, val playIcon: Icon, val pauseIcon: Icon, @@ -539,8 +539,8 @@ data class ContentMusicPlayButtonRenderer ( val activeScaleFactor: Long, val buttonSize: ButtonSize, val rippleTarget: RippleTarget, - val accessibilityPlayData: Accessibility, - val accessibilityPauseData: Accessibility + val accessibilityPlayData: Accessibility? = null, + val accessibilityPauseData: Accessibility? = null ) @Serializable @@ -713,7 +713,7 @@ data class MusicDescriptionShelfRenderer ( val moreButton: MoreButton, val trackingParams: String, val shelfStyle: String, - val straplineBadge: List + val straplineBadge: List? = null ) @Serializable diff --git a/innertube/src/main/kotlin/it/fast4x/innertube/requests/AlbumPage.kt b/innertube/src/main/kotlin/it/fast4x/innertube/requests/AlbumPage.kt index 15e9df21da..2cc0be2678 100644 --- a/innertube/src/main/kotlin/it/fast4x/innertube/requests/AlbumPage.kt +++ b/innertube/src/main/kotlin/it/fast4x/innertube/requests/AlbumPage.kt @@ -96,9 +96,10 @@ suspend fun Innertube.albumPageDetails(body: BrowseBody) = runCatching { body.context.apply() }.body() - val musicDetailHeaderRenderer = response.contents.twoColumnBrowseResultsRenderer.tabs.firstOrNull() - ?.tabRenderer?.content?.sectionListRenderer?.contents?.firstOrNull() - ?.musicResponsiveHeaderRenderer + val musicDetailHeaderRenderer = + response.contents.twoColumnBrowseResultsRenderer.tabs.firstOrNull() + ?.tabRenderer?.content?.sectionListRenderer?.contents?.firstOrNull() + ?.musicResponsiveHeaderRenderer /* @@ -117,7 +118,7 @@ suspend fun Innertube.albumPageDetails(body: BrowseBody) = runCatching { title = null, description = musicDetailHeaderRenderer ?.description - ?.musicDescriptionShelfRenderer?.description?.runs?.joinToString("") { it.text ?: "" }, + ?.musicDescriptionShelfRenderer?.description?.runs?.joinToString("") { it.text }, thumbnail = null, authors = null, year = null, @@ -125,10 +126,10 @@ suspend fun Innertube.albumPageDetails(body: BrowseBody) = runCatching { songsPage = null, otherVersions = null, otherInfo = musicDetailHeaderRenderer - ?.secondSubtitle?.runs?.joinToString("") { it.text ?: "" } + ?.secondSubtitle?.runs?.joinToString("") { it.text } ) }.onFailure { - println("ERROR IN Innertube albumPageDetails "+it.message) + println("mediaItem ERROR IN Innertube albumPageDetails " + it.message) } diff --git a/innertube/src/main/kotlin/it/fast4x/innertube/requests/PlaylistPage.kt b/innertube/src/main/kotlin/it/fast4x/innertube/requests/PlaylistPage.kt index 0e6520e0de..ec3f5b70fa 100644 --- a/innertube/src/main/kotlin/it/fast4x/innertube/requests/PlaylistPage.kt +++ b/innertube/src/main/kotlin/it/fast4x/innertube/requests/PlaylistPage.kt @@ -10,7 +10,6 @@ import it.fast4x.innertube.models.ContinuationResponse import it.fast4x.innertube.models.MusicCarouselShelfRenderer import it.fast4x.innertube.models.MusicShelfRenderer import it.fast4x.innertube.models.bodies.BrowseBody -import it.fast4x.innertube.models.bodies.BrowseBodyWithLocale import it.fast4x.innertube.models.bodies.ContinuationBody import it.fast4x.innertube.utils.from @@ -21,6 +20,8 @@ suspend fun Innertube.playlistPage(body: BrowseBody) = runCatching { body.context.apply() }.body() + println("mediaItem twoColumnBrowseResultsRenderer ${response.contents?.twoColumnBrowseResultsRenderer}") + if (response.contents?.twoColumnBrowseResultsRenderer == null) { /* OLD */ @@ -83,13 +84,13 @@ suspend fun Innertube.playlistPage(body: BrowseBody) = runCatching { otherInfo = header ?.secondSubtitle ?.text - ) + ) } else { /* NEW */ val header = response .contents - .twoColumnBrowseResultsRenderer - .tabs + ?.twoColumnBrowseResultsRenderer + ?.tabs ?.firstOrNull() ?.tabRenderer ?.content @@ -100,8 +101,8 @@ suspend fun Innertube.playlistPage(body: BrowseBody) = runCatching { val contents = response .contents - .twoColumnBrowseResultsRenderer - .secondaryContents + ?.twoColumnBrowseResultsRenderer + ?.secondaryContents ?.sectionListRenderer ?.contents @@ -155,7 +156,7 @@ suspend fun Innertube.playlistPage(body: BrowseBody) = runCatching { } }.onFailure { - println("ERROR IN Innertube playlistpage "+it.message) + println("mediaItem ERROR IN Innertube playlistpage " + it.message) }