Skip to content

Commit

Permalink
Fixed all "unsupported" id's in the Listening History. Made the login…
Browse files Browse the repository at this point in the history
… tokens appear in debug mode
  • Loading branch information
BobbyESP committed Dec 9, 2022
1 parent 80d557b commit b123f00
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package bruhcollective.itaysonlab.jetispot.core.di

import bruhcollective.itaysonlab.jetispot.BuildConfig
import bruhcollective.itaysonlab.jetispot.core.SpSessionManager
import bruhcollective.itaysonlab.jetispot.core.api.*
import bruhcollective.itaysonlab.jetispot.core.di.ext.interceptRequest
Expand Down Expand Up @@ -31,7 +32,13 @@ object ApiModule {
interceptRequest { orig ->
// 1. Authorization (& client token)
header("Authorization", "Bearer ${sessionManager.session.tokens().get("playlist-read")}")
if(BuildConfig.DEBUG){
Log.d("Authorization Bearer token", "Bearer ${sessionManager.session.tokens().get("playlist-read")}")
}
header("client-token", tokenHandler.requestToken())
if(BuildConfig.DEBUG){
Log.d("Authorization Client Token", tokenHandler.requestToken())
}

// 2. Default headers
header("User-Agent", "Spotify/${SpUtils.SPOTIFY_APP_VERSION} Android/32 (Pixel 4a (5G))")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,13 @@ sealed class HubComponent {
@TypeLabel("artist:likedSongsRow")
object ArtistLikedSongs: HubComponent()

@TypeLabel("listeninghistory:playlistContextRow")
@TypeLabel("listeninghistory:playlistContextRow", alternateLabels = ["listeninghistory:collectionContextRow", "listeninghistory:albumContextRow"])
object HistoryPlaylist: HubComponent()

// BROWSE
@TypeLabel("listeninghistory:dividerAfterPlaysFromContextRow")
object HistoryDivider: HubComponent()

// BROWSE
@TypeLabel("find:categoryCard")
object FindCard: HubComponent(), ComponentInGrid

Expand Down Expand Up @@ -99,7 +101,7 @@ sealed class HubComponent {

// IGNORING

@TypeLabel("listeninghistory:dividerAfterEntityRow")
@TypeLabel("listeninghistory:dividerAfterEntityRow", alternateLabels = ["listeninghistory:playsFromContextRow", "listeninghistory:artistContextRow" /*This by the moment*/])
object EmptySpace: HubComponent()

@TypeLabel("freetier:offlineSwitchComponent", alternateLabels = ["find:header"])
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ package bruhcollective.itaysonlab.jetispot.ui.hub

import androidx.compose.foundation.layout.Spacer
import androidx.compose.foundation.layout.height
import androidx.compose.foundation.layout.padding
import androidx.compose.material3.Divider
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
Expand Down Expand Up @@ -60,7 +62,9 @@ fun HubBinder (
HubComponent.PodcastTopics -> PodcastTopicsStrip(item)

HubComponent.OutlinedButton -> OutlineButton(item)

HubComponent.HistoryPlaylist -> PlaylistTrackRowLarger(item)
HubComponent.HistoryDivider -> Divider(modifier = Modifier.padding(start = 14.dp, end = 14.dp).height(2.dp))

//TODO: Keep adding components searching them in the API (Thunder client)
HubComponent.EmptySpace, HubComponent.Ignored -> {}
Expand Down

0 comments on commit b123f00

Please sign in to comment.