Skip to content

Commit

Permalink
New release version 0.6.40.1
Browse files Browse the repository at this point in the history
  • Loading branch information
fast4x committed Jun 24, 2024
1 parent 4ed66ae commit 7a2f4c2
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 24 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
)
Expand All @@ -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 ->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,12 +86,12 @@ data class MusicResponsiveListItemRenderer (
val overlay: Overlay,
val flexColumns: List<FlexColumn>,
val fixedColumns: List<FixedColumn>,
val menu: Menu,
val menu: Menu? = null,
val badges: List<Badge>? = null,
val playlistItemData: PlaylistItemData,
val playlistItemData: PlaylistItemData? = null,
val itemHeight: ItemHeight,
val index: Index,
val multiSelectCheckbox: MultiSelectCheckbox
val multiSelectCheckbox: MultiSelectCheckbox? = null
)

@Serializable
Expand Down Expand Up @@ -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,
Expand All @@ -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
Expand Down Expand Up @@ -713,7 +713,7 @@ data class MusicDescriptionShelfRenderer (
val moreButton: MoreButton,
val trackingParams: String,
val shelfStyle: String,
val straplineBadge: List<Badge>
val straplineBadge: List<Badge>? = null
)

@Serializable
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,9 +96,10 @@ suspend fun Innertube.albumPageDetails(body: BrowseBody) = runCatching {
body.context.apply()
}.body<BrowseResponse0624>()

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

/*
Expand All @@ -117,18 +118,18 @@ 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,
url = null,
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)
}
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -21,6 +20,8 @@ suspend fun Innertube.playlistPage(body: BrowseBody) = runCatching {
body.context.apply()
}.body<BrowseResponse>()

println("mediaItem twoColumnBrowseResultsRenderer ${response.contents?.twoColumnBrowseResultsRenderer}")


if (response.contents?.twoColumnBrowseResultsRenderer == null) {
/* OLD */
Expand Down Expand Up @@ -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
Expand All @@ -100,8 +101,8 @@ suspend fun Innertube.playlistPage(body: BrowseBody) = runCatching {

val contents = response
.contents
.twoColumnBrowseResultsRenderer
.secondaryContents
?.twoColumnBrowseResultsRenderer
?.secondaryContents
?.sectionListRenderer
?.contents

Expand Down Expand Up @@ -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)
}


Expand Down

0 comments on commit 7a2f4c2

Please sign in to comment.