Unofficial YouTube Music / Spotify Premium client for Android, built in Liquid Glass. Audio effects, Spotify Connect, listening history, 8 languages. Rust core on librespot.
Kotlin alternativeandroidandroid-applicationclientglassmorphisminnertubelibrespotliquid-glassspotifyspotify-connectspotifyapiyoutube-musicyoutube-playerytdlnis
Swap the player's heart for add-to-playlist
Lelonioc1f0a6ba4a5c
diff --git a/.claude/settings.local.json b/.claude/settings.local.jsonindex 010d013..873690e 100644--- a/.claude/settings.local.json+++ b/.claude/settings.local.json@@ -105,7 +105,8 @@"Bash(git commit -q -m 'Close the player by gesture, not by dragging it around *)","Bash(git commit -q -m 'Open the player with a transform instead of a resize *)","Bash(git commit -q -m 'Add a settings screen behind the account picture *)",- "Bash(git commit -q -m 'Credit the author in the settings *)"+ "Bash(git commit -q -m 'Credit the author in the settings *)",+ "Bash(git commit -q -m 'Swap the player'\\\\''s heart for add-to-playlist *)"]}}diff --git a/app/.cxx/RelWithDebInfo/151m4dr6/arm64-v8a/configure_fingerprint.bin b/app/.cxx/RelWithDebInfo/151m4dr6/arm64-v8a/configure_fingerprint.binindex 7f34747..40f6a21 100644--- a/app/.cxx/RelWithDebInfo/151m4dr6/arm64-v8a/configure_fingerprint.bin+++ b/app/.cxx/RelWithDebInfo/151m4dr6/arm64-v8a/configure_fingerprint.bin@@ -2,27 +2,27 @@ C/C++ Structured Logljh/Users/emanuele/Progetto Spotify/app/.cxx/RelWithDebInfo/151m4dr6/arm64-v8a/additional_project_files.txtCA-?com.android.build.gradle.internal.cxx.io.EncodedFileFingerPrint �����3 ����3i+?com.android.build.gradle.internal.cxx.io.EncodedFileFingerPrint 첀��3 ����3ig-e/Users/emanuele/Progetto Spotify/app/.cxx/RelWithDebInfo/151m4dr6/arm64-v8a/android_gradle_build.json �����3� ����3n+e/Users/emanuele/Progetto Spotify/app/.cxx/RelWithDebInfo/151m4dr6/arm64-v8a/android_gradle_build.json �����3� ����3nl-j/Users/emanuele/Progetto Spotify/app/.cxx/RelWithDebInfo/151m4dr6/arm64-v8a/android_gradle_build_mini.json �����3� �����3[+j/Users/emanuele/Progetto Spotify/app/.cxx/RelWithDebInfo/151m4dr6/arm64-v8a/android_gradle_build_mini.json �����3� �����3[Y-W/Users/emanuele/Progetto Spotify/app/.cxx/RelWithDebInfo/151m4dr6/arm64-v8a/build.ninja �����3�� ����3_+W/Users/emanuele/Progetto Spotify/app/.cxx/RelWithDebInfo/151m4dr6/arm64-v8a/build.ninja �����3�� ����3_]-[/Users/emanuele/Progetto Spotify/app/.cxx/RelWithDebInfo/151m4dr6/arm64-v8a/build.ninja.txt �����3d+[/Users/emanuele/Progetto Spotify/app/.cxx/RelWithDebInfo/151m4dr6/arm64-v8a/build.ninja.txt �����3db-`/Users/emanuele/Progetto Spotify/app/.cxx/RelWithDebInfo/151m4dr6/arm64-v8a/build_file_index.txt �����3 @ ����3e+`/Users/emanuele/Progetto Spotify/app/.cxx/RelWithDebInfo/151m4dr6/arm64-v8a/build_file_index.txt �����3 @ ����3ec-a/Users/emanuele/Progetto Spotify/app/.cxx/RelWithDebInfo/151m4dr6/arm64-v8a/compile_commands.json �����3�� ����3i+a/Users/emanuele/Progetto Spotify/app/.cxx/RelWithDebInfo/151m4dr6/arm64-v8a/compile_commands.json �����3�� ����3ig-e/Users/emanuele/Progetto Spotify/app/.cxx/RelWithDebInfo/151m4dr6/arm64-v8a/compile_commands.json.bin �����3 �" ����3o+e/Users/emanuele/Progetto Spotify/app/.cxx/RelWithDebInfo/151m4dr6/arm64-v8a/compile_commands.json.bin �����3 �" ����3om-k/Users/emanuele/Progetto Spotify/app/.cxx/RelWithDebInfo/151m4dr6/arm64-v8a/metadata_generation_command.txt �����3+k/Users/emanuele/Progetto Spotify/app/.cxx/RelWithDebInfo/151m4dr6/arm64-v8a/metadata_generation_command.txt �����3� ����3b`-^/Users/emanuele/Progetto Spotify/app/.cxx/RelWithDebInfo/151m4dr6/arm64-v8a/prefab_config.json �����3 ( ����3g+^/Users/emanuele/Progetto Spotify/app/.cxx/RelWithDebInfo/151m4dr6/arm64-v8a/prefab_config.json �����3 ( ����3ge-c/Users/emanuele/Progetto Spotify/app/.cxx/RelWithDebInfo/151m4dr6/arm64-v8a/symbol_folder_index.txt �����3 b ����3D+c/Users/emanuele/Progetto Spotify/app/.cxx/RelWithDebInfo/151m4dr6/arm64-v8a/symbol_folder_index.txt �����3 b ����3DB-@/Users/emanuele/Progetto Spotify/app/src/main/cpp/CMakeLists.txt �����3 � �Ȅ��3\ No newline at end of file+@/Users/emanuele/Progetto Spotify/app/src/main/cpp/CMakeLists.txt �����3 � �Ȅ��3\ No newline at end of filediff --git a/app/src/main/java/dev/emanuele/spot/data/SpotifyApi.kt b/app/src/main/java/dev/emanuele/spot/data/SpotifyApi.ktindex dda2a00..f13c4d4 100644--- a/app/src/main/java/dev/emanuele/spot/data/SpotifyApi.kt+++ b/app/src/main/java/dev/emanuele/spot/data/SpotifyApi.kt@@ -3,8 +3,8 @@ package dev.emanuele.spot.dataimport kotlinx.serialization.SerialNameimport kotlinx.serialization.Serializableimport retrofit2.http.Body-import retrofit2.http.DELETEimport retrofit2.http.GET+import retrofit2.http.POSTimport retrofit2.http.PUTimport retrofit2.http.Pathimport retrofit2.http.Query@@ -101,19 +101,16 @@ interface SpotifyApi {suspend fun transferPlayback(@Body request: TransferRequestDto)/**- * Whether tracks are in the user's Liked Songs.- *- * Answers one boolean per id, in the order asked. Needs `user-library-read`.+ * Appends tracks to a playlist. Needs `playlist-modify-private` for the+ * user's own private playlists and `playlist-modify-public` for their+ * public ones — which one applies is the playlist's visibility, not the+ * caller's, so both are asked for.*/- @GET("v1/me/tracks/contains")- suspend fun areSaved(@Query("ids") ids: String): List<Boolean>-- /** Needs `user-library-modify`. */- @PUT("v1/me/tracks")- suspend fun saveTracks(@Query("ids") ids: String)-- @DELETE("v1/me/tracks")- suspend fun removeTracks(@Query("ids") ids: String)+ @POST("v1/playlists/{id}/tracks")+ suspend fun addToPlaylist(+ @Path("id") playlistId: String,+ @Body request: AddTracksRequestDto,+ )@GET("v1/search")suspend fun search(@@ -123,6 +120,9 @@ interface SpotifyApi {): SearchDto}+@Serializable+data class AddTracksRequestDto(val uris: List<String>)+@Serializabledata class PageDto<T>(val items: List<T>,diff --git a/app/src/main/java/dev/emanuele/spot/ui/MainViewModel.kt b/app/src/main/java/dev/emanuele/spot/ui/MainViewModel.ktindex 6219c50..17cbc22 100644--- a/app/src/main/java/dev/emanuele/spot/ui/MainViewModel.kt+++ b/app/src/main/java/dev/emanuele/spot/ui/MainViewModel.kt@@ -6,6 +6,7 @@ import androidx.lifecycle.viewModelScopeimport dev.emanuele.spot.SpotApplicationimport dev.emanuele.spot.auth.SpotifyOAuthimport dev.emanuele.spot.data.Catalog+import dev.emanuele.spot.data.AddTracksRequestDtoimport dev.emanuele.spot.data.CatalogPlaylistimport dev.emanuele.spot.data.CatalogTrackimport dev.emanuele.spot.data.SearchItem@@ -243,54 +244,81 @@ class MainViewModel(app: Application) : AndroidViewModel(app) {}/**- * Whether the playing track is in Liked Songs.+ * The "add to playlist" sheet.*- * Null while unknown — no Web API application, the check still in flight, or- * it failed. The heart is drawn inert in that case rather than guessing,- * because guessing wrong here silently removes something from a library.+ * Replaces the heart the player used to have. Liked Songs is one playlist+ * out of the account's several and the button spent its whole width saying+ * so; asking which playlist is the same gesture and answers the question the+ * heart could not.*/- private val _liked = MutableStateFlow<Boolean?>(null)- val liked: StateFlow<Boolean?> = _liked.asStateFlow()- private var likedJob: Job? = null- private var likedUri: String? = null-- fun checkLiked(trackUri: String?) {- likedJob?.cancel()- likedUri = trackUri- _liked.value = null- val id = trackUri?.takeIf { it.startsWith("spotify:track:") }- ?.substringAfterLast(':')- ?: return- if (!container.webApi.isReady) return-- likedJob = viewModelScope.launch {- runCatching { container.api.areSaved(id).firstOrNull() }- .onSuccess { _liked.value = it }- .onFailure { android.util.Log.w(TAG, "liked check failed: ${describe(it)}") }- }+ data class AddToPlaylistState(+ val open: Boolean = false,+ /** The track the sheet will add, captured when it opens. */+ val trackUri: String? = null,+ val trackTitle: String = "",+ val playlists: List<CatalogPlaylist> = emptyList(),+ /** URI of the playlist currently being written to. */+ val busy: String? = null,+ /** Name of the playlist the track just went into. */+ val done: String? = null,+ val error: String? = null,+ )++ private val _addToPlaylist = MutableStateFlow(AddToPlaylistState())+ val addToPlaylist: StateFlow<AddToPlaylistState> = _addToPlaylist.asStateFlow()++ fun openAddToPlaylist(trackUri: String?, trackTitle: String) {+ _addToPlaylist.value = AddToPlaylistState(+ open = true,+ trackUri = trackUri,+ trackTitle = trackTitle,+ playlists = (_state.value as? UiState.Ready)?.playlists.orEmpty(),+ error = when {+ trackUri?.startsWith("spotify:track:") != true ->+ "Questo brano non può essere aggiunto."+ !container.webApi.isReady ->+ "Collega la tua applicazione nelle impostazioni."+ else -> null+ },+ )+ }++ fun closeAddToPlaylist() {+ _addToPlaylist.value = _addToPlaylist.value.copy(open = false)}/**- * Adds or removes the playing track.+ * Appends the captured track to [playlist].*- * The state is flipped before the call and put back if it fails: a heart- * that waits for a round trip feels broken, and one that lies about the- * outcome is worse.+ * Not optimistic, unlike the heart it replaces: this writes to something the+ * user keeps, the result is a row appearing in a list rather than a filled+ * icon, and there is nothing to undo it with if the call turns out to have+ * failed. So the sheet waits, then says which playlist it went into.*/- fun toggleLiked() {- val id = likedUri?.takeIf { it.startsWith("spotify:track:") }- ?.substringAfterLast(':')- ?: return- val wasLiked = _liked.value ?: return+ fun addToPlaylist(playlist: CatalogPlaylist) {+ val current = _addToPlaylist.value+ val trackUri = current.trackUri ?: return+ if (current.busy != null) return+ val id = playlist.uri.substringAfterLast(':')- _liked.value = !wasLiked+ _addToPlaylist.value = current.copy(busy = playlist.uri, done = null, error = null)viewModelScope.launch {- runCatching {- if (wasLiked) container.api.removeTracks(id) else container.api.saveTracks(id)- }.onFailure {- android.util.Log.e(TAG, "like failed: ${chain(it)}", it)- _liked.value = wasLiked- }+ runCatching { container.api.addToPlaylist(id, AddTracksRequestDto(listOf(trackUri))) }+ .onSuccess {+ _addToPlaylist.value =+ _addToPlaylist.value.copy(busy = null, done = playlist.name)+ }+ .onFailure {+ android.util.Log.e(TAG, "add to playlist failed: ${chain(it)}", it)+ _addToPlaylist.value = _addToPlaylist.value.copy(+ busy = null,+ // A playlist the account follows but does not own is the+ // one failure worth naming: it looks identical to the+ // user's own in every list the app draws.+ error = "Non è stato possibile aggiungere a ${playlist.name}. " ++ "Se la playlist non è tua, non puoi modificarla.",+ )+ }}}@@ -400,9 +428,11 @@ class MainViewModel(app: Application) : AndroidViewModel(app) {// playback."user-read-playback-state","user-modify-playback-state",- // The heart in the player.- "user-library-read",- "user-library-modify",+ // The player's "add to playlist". Which of the two+ // applies is the playlist's own visibility, not the+ // caller's, so both are asked for.+ "playlist-modify-private",+ "playlist-modify-public",),)}diff --git a/app/src/main/java/dev/emanuele/spot/ui/SpotApp.kt b/app/src/main/java/dev/emanuele/spot/ui/SpotApp.ktindex dcaa350..85b265e 100644--- a/app/src/main/java/dev/emanuele/spot/ui/SpotApp.kt+++ b/app/src/main/java/dev/emanuele/spot/ui/SpotApp.kt@@ -155,7 +155,7 @@ fun SpotApp(val feed by viewModel.feed.collectAsStateWithLifecycle()val playlistOrder by viewModel.playlistOrder.collectAsStateWithLifecycle()val devices by viewModel.devices.collectAsStateWithLifecycle()- val liked by viewModel.liked.collectAsStateWithLifecycle()+ val addToPlaylist by viewModel.addToPlaylist.collectAsStateWithLifecycle()// Once, on the first composition that has a usable Web API session. The// ViewModel keeps what it fetched, so navigating away and back does not@@ -202,8 +202,6 @@ fun SpotApp()}- LaunchedEffect(playback.mediaId) { viewModel.checkLiked(playback.mediaId) }-var canvas by remember { mutableStateOf<CanvasClip?>(null) }// Fetched per track, like the lyrics. Most tracks have none, so a null is an@@ -473,8 +471,12 @@ fun SpotApp(onCloseDevices = viewModel::closeDevices,onRefreshDevices = viewModel::refreshDevices,onSelectDevice = { viewModel.transferPlayback(it) },- liked = liked,- onToggleLiked = viewModel::toggleLiked,+ addToPlaylist = addToPlaylist,+ onAddToPlaylist = {+ viewModel.openAddToPlaylist(playback.mediaId, playback.title)+ },+ onPickPlaylist = viewModel::addToPlaylist,+ onCloseAddToPlaylist = viewModel::closeAddToPlaylist,)},)diff --git a/app/src/main/java/dev/emanuele/spot/ui/player/AddToPlaylistSheet.kt b/app/src/main/java/dev/emanuele/spot/ui/player/AddToPlaylistSheet.ktnew file mode 100644index 0000000..a81e90e--- /dev/null+++ b/app/src/main/java/dev/emanuele/spot/ui/player/AddToPlaylistSheet.kt@@ -0,0 +1,186 @@+package dev.emanuele.spot.ui.player++import androidx.compose.foundation.background+import androidx.compose.foundation.clickable+import androidx.compose.foundation.layout.Arrangement+import androidx.compose.foundation.layout.Box+import androidx.compose.foundation.layout.Column+import androidx.compose.foundation.layout.Row+import androidx.compose.foundation.layout.fillMaxSize+import androidx.compose.foundation.layout.fillMaxWidth+import androidx.compose.foundation.layout.heightIn+import androidx.compose.foundation.layout.padding+import androidx.compose.foundation.layout.size+import androidx.compose.foundation.rememberScrollState+import androidx.compose.foundation.shape.RoundedCornerShape+import androidx.compose.foundation.verticalScroll+import androidx.compose.material3.CircularProgressIndicator+import androidx.compose.material3.Icon+import androidx.compose.material3.MaterialTheme+import androidx.compose.material3.Text+import androidx.compose.runtime.Composable+import androidx.compose.ui.Alignment+import androidx.compose.ui.Modifier+import androidx.compose.ui.draw.clip+import androidx.compose.ui.graphics.Color+import androidx.compose.ui.text.style.TextOverflow+import androidx.compose.ui.unit.dp+import com.adamglin.PhosphorIcons+import com.adamglin.phosphoricons.Regular+import com.adamglin.phosphoricons.regular.Check+import com.kyant.backdrop.Backdrop+import dev.emanuele.spot.data.CatalogPlaylist+import dev.emanuele.spot.ui.MainViewModel+import dev.emanuele.spot.ui.components.Artwork++/**+ * Which playlist the playing track should go into.+ *+ * The plus in the player opens this. It stands where a heart used to, and the+ * heart is what it fixes: Liked Songs is one playlist out of the account's+ * several, and a button that could only ever add to that one spent its whole+ * width answering a question nobody asked.+ *+ * The rows do not close the sheet. Adding one track to two playlists is a+ * perfectly ordinary thing to want, and a sheet that dismissed itself on the+ * first tap would make it two round trips through the player.+ */+@Composable+fun AddToPlaylistSheet(+ state: MainViewModel.AddToPlaylistState,+ backdrop: Backdrop,+ onSelect: (CatalogPlaylist) -> Unit,+ onDismiss: () -> Unit,+) {+ Box(+ Modifier+ .fillMaxSize()+ .background(Color.Black.copy(alpha = 0.45f))+ .clickable(interactionSource = null, indication = null, onClick = onDismiss),+ contentAlignment = Alignment.BottomCenter,+ ) {+ GlassSurface(+ backdrop = backdrop,+ shape = RoundedCornerShape(28.dp),+ surfaceColor = GlassFilm,+ modifier = Modifier+ .padding(16.dp)+ .fillMaxWidth()+ .clip(RoundedCornerShape(28.dp))+ // Swallows taps so one inside the sheet does not dismiss it.+ .clickable(interactionSource = null, indication = null) {},+ ) {+ Column(Modifier.padding(vertical = 18.dp)) {+ Text(+ "Aggiungi a una playlist",+ style = MaterialTheme.typography.titleLarge,+ color = GlassInk,+ modifier = Modifier.padding(start = 22.dp, end = 22.dp),+ )+ Text(+ // Says what is being added: the sheet can outlive the track+ // that opened it, since playback carries on underneath.+ state.trackTitle,+ style = MaterialTheme.typography.bodyMedium,+ color = GlassInkDim,+ maxLines = 1,+ overflow = TextOverflow.Ellipsis,+ modifier = Modifier.padding(start = 22.dp, end = 22.dp, top = 2.dp, bottom = 12.dp),+ )++ if (state.error != null) {+ Text(+ state.error,+ style = MaterialTheme.typography.bodyMedium,+ color = MaterialTheme.colorScheme.error,+ modifier = Modifier.padding(horizontal = 22.dp, vertical = 8.dp),+ )+ }++ if (state.done != null) {+ Text(+ "Aggiunto a ${state.done}",+ style = MaterialTheme.typography.bodyMedium,+ color = MaterialTheme.colorScheme.primary,+ modifier = Modifier.padding(horizontal = 22.dp, vertical = 8.dp),+ )+ }++ if (state.playlists.isEmpty()) {+ Text(+ "Nessuna playlist nel tuo account",+ style = MaterialTheme.typography.bodyMedium,+ color = GlassInkDim,+ modifier = Modifier.padding(horizontal = 22.dp, vertical = 12.dp),+ )+ } else {+ Column(+ Modifier+ .heightIn(max = 360.dp)+ .verticalScroll(rememberScrollState()),+ verticalArrangement = Arrangement.spacedBy(2.dp),+ ) {+ state.playlists.forEach { playlist ->+ PlaylistRow(+ playlist = playlist,+ busy = state.busy == playlist.uri,+ added = state.done == playlist.name,+ enabled = state.trackUri != null && state.busy == null,+ onClick = { onSelect(playlist) },+ )+ }+ }+ }+ }+ }+ }+}++@Composable+private fun PlaylistRow(+ playlist: CatalogPlaylist,+ busy: Boolean,+ added: Boolean,+ enabled: Boolean,+ onClick: () -> Unit,+) {+ Row(+ Modifier+ .fillMaxWidth()+ .clickable(enabled = enabled, onClick = onClick)+ .padding(horizontal = 22.dp, vertical = 10.dp),+ verticalAlignment = Alignment.CenterVertically,+ ) {+ Artwork(+ url = playlist.artworkUrl,+ title = playlist.name,+ modifier = Modifier.size(44.dp),+ corner = 10.dp,+ decodeSize = 44.dp,+ )+ Text(+ playlist.name,+ style = MaterialTheme.typography.titleMedium,+ color = GlassInk,+ maxLines = 1,+ overflow = TextOverflow.Ellipsis,+ modifier = Modifier+ .padding(start = 16.dp)+ .weight(1f),+ )+ when {+ busy -> CircularProgressIndicator(+ color = GlassInkDim,+ strokeWidth = 2.dp,+ modifier = Modifier.size(18.dp),+ )++ added -> Icon(+ PhosphorIcons.Regular.Check,+ contentDescription = null,+ tint = MaterialTheme.colorScheme.primary,+ modifier = Modifier.size(20.dp),+ )+ }+ }+}diff --git a/app/src/main/java/dev/emanuele/spot/ui/player/PlayerScreen.kt b/app/src/main/java/dev/emanuele/spot/ui/player/PlayerScreen.ktindex 110848b..b56f4c6 100644--- a/app/src/main/java/dev/emanuele/spot/ui/player/PlayerScreen.kt+++ b/app/src/main/java/dev/emanuele/spot/ui/player/PlayerScreen.kt@@ -63,6 +63,7 @@ import com.kyant.backdrop.Backdropimport com.kyant.backdrop.backdrops.layerBackdropimport com.kyant.backdrop.backdrops.rememberCombinedBackdropimport com.kyant.backdrop.backdrops.rememberLayerBackdrop+import dev.emanuele.spot.ui.MainViewModelimport dev.emanuele.spot.ui.components.Artworkimport dev.emanuele.spot.ui.glass.LiquidButtonimport dev.emanuele.spot.ui.library.formatDuration@@ -70,14 +71,13 @@ import dev.emanuele.spot.ui.theme.softShadowimport com.adamglin.PhosphorIconsimport com.adamglin.phosphoricons.Fillimport com.adamglin.phosphoricons.Regular-import com.adamglin.phosphoricons.fill.Heartimport com.adamglin.phosphoricons.fill.Pauseimport com.adamglin.phosphoricons.fill.Playimport com.adamglin.phosphoricons.fill.SkipBackimport com.adamglin.phosphoricons.fill.SkipForwardimport com.adamglin.phosphoricons.regular.CaretDownimport com.adamglin.phosphoricons.regular.Devices-import com.adamglin.phosphoricons.regular.Heart+import com.adamglin.phosphoricons.regular.Plusimport com.adamglin.phosphoricons.regular.Queueimport com.adamglin.phosphoricons.regular.Repeatimport com.adamglin.phosphoricons.regular.RepeatOnce@@ -148,9 +148,11 @@ fun PlayerScreen(onCloseDevices: () -> Unit,onRefreshDevices: () -> Unit,onSelectDevice: (String) -> Unit,- /** Null while unknown; see MainViewModel.liked. */- liked: Boolean?,- onToggleLiked: () -> Unit,+ /** The "add to playlist" sheet, and the button that opens it. */+ addToPlaylist: MainViewModel.AddToPlaylistState,+ onAddToPlaylist: () -> Unit,+ onPickPlaylist: (dev.emanuele.spot.data.CatalogPlaylist) -> Unit,+ onCloseAddToPlaylist: () -> Unit,) {var panel by remember { mutableStateOf(PlayerPanel.NONE) }@@ -430,28 +432,12 @@ fun PlayerScreen(RoundGlassButton(backdrop = glassBackdrop,size = 40.dp,- // Inert until the check has answered:- // guessing wrong here silently removes- // something from a library.- enabled = liked != null,- onClick = onToggleLiked,+ onClick = onAddToPlaylist,) {Icon(- if (liked == true) {- PhosphorIcons.Fill.Heart- } else {- PhosphorIcons.Regular.Heart- },- contentDescription = if (liked == true) {- "Togli dai brani salvati"- } else {- "Salva"- },- tint = if (liked == true) {- MaterialTheme.colorScheme.primary- } else {- GlassInk- },+ PhosphorIcons.Regular.Plus,+ contentDescription = "Aggiungi a una playlist",+ tint = GlassInk,modifier = Modifier.size(20.dp),)}@@ -514,6 +500,15 @@ fun PlayerScreen(// Over everything, including the transport: it is a modal choice, and// the controls underneath would be operating a device the user is in// the middle of changing.+ if (addToPlaylist.open) {+ AddToPlaylistSheet(+ state = addToPlaylist,+ backdrop = glassBackdrop,+ onSelect = onPickPlaylist,+ onDismiss = onCloseAddToPlaylist,+ )+ }+if (devices.open) {DevicePicker(state = devices,diff --git a/app/src/main/java/dev/emanuele/spot/ui/settings/SettingsScreen.kt b/app/src/main/java/dev/emanuele/spot/ui/settings/SettingsScreen.ktindex 8494fe4..61b1231 100644--- a/app/src/main/java/dev/emanuele/spot/ui/settings/SettingsScreen.kt+++ b/app/src/main/java/dev/emanuele/spot/ui/settings/SettingsScreen.kt@@ -356,8 +356,8 @@ private val SCOPES = listOf("user-top-read" to "Artisti che ascolti","user-read-playback-state" to "Elenco dispositivi","user-modify-playback-state" to "Sposta la riproduzione",- "user-library-read" to "Brani salvati",- "user-library-modify" to "Cuore nel player",+ "playlist-modify-private" to "Aggiungi a playlist private",+ "playlist-modify-public" to "Aggiungi a playlist pubbliche",)private val LICENCES = listOf(