Skip to content

Commit

Permalink
fix: Spotify search not querying full artist name
Browse files Browse the repository at this point in the history
Signed-off-by: Gabriel Fontán <[email protected]>
  • Loading branch information
BobbyESP committed Jul 29, 2024
1 parent 0dd9dab commit 88d6479
Show file tree
Hide file tree
Showing 8 changed files with 11 additions and 763 deletions.
4 changes: 1 addition & 3 deletions app/src/main/java/com/bobbyesp/metadator/ext/Song.kt
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,9 @@ import com.bobbyesp.metadator.model.ParcelableSong
import com.bobbyesp.utilities.model.Song

fun Song.toParcelableSong(): ParcelableSong {
val artistsList = this.artist.toList()
val mainArtist = artistsList.first().toString()
return ParcelableSong(
name = this.title,
mainArtist = mainArtist,
mainArtist = this.artist,
localPath = this.path,
artworkPath = this.artworkPath,
filename = this.fileName
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,8 @@ import com.bobbyesp.metadator.presentation.pages.mediaplayer.player.CollapsedPla
import com.bobbyesp.metadator.presentation.pages.mediaplayer.player.PlayerAnimationSpec
import com.bobbyesp.metadator.presentation.pages.settings.SettingsPage
import com.bobbyesp.metadator.presentation.pages.settings.modules.GeneralSettingsPage
import com.bobbyesp.metadator.presentation.pages.utilities.tageditor.rework.MetadataEditorPage
import com.bobbyesp.metadator.presentation.pages.utilities.tageditor.rework.MetadataEditorVM
import com.bobbyesp.metadator.presentation.pages.utilities.tageditor.MetadataEditorPage
import com.bobbyesp.metadator.presentation.pages.utilities.tageditor.MetadataEditorVM
import com.bobbyesp.metadator.presentation.pages.utilities.tageditor.spotify.MetadataBsVM
import com.bobbyesp.ui.components.bottomsheet.draggable.rememberDraggableBottomSheetState
import com.bobbyesp.ui.components.tags.RoundedTag
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,7 @@ fun MediaStorePage(
when (type) {
LayoutType.Grid -> {
LazyVerticalGridScrollbar(
state = lazyGridState,
settings = ScrollbarSettings(
state = lazyGridState, settings = ScrollbarSettings(
thumbUnselectedColor = MaterialTheme.colorScheme.onSurfaceVariant,
thumbSelectedColor = MaterialTheme.colorScheme.primary,
selectionActionable = ScrollbarSelectionActionable.WhenVisible,
Expand Down Expand Up @@ -98,8 +97,7 @@ fun MediaStorePage(

LayoutType.List -> {
LazyColumnScrollbar(
state = lazyListState,
settings = ScrollbarSettings(
state = lazyListState, settings = ScrollbarSettings(
thumbUnselectedColor = MaterialTheme.colorScheme.onSurfaceVariant,
thumbSelectedColor = MaterialTheme.colorScheme.primary,
selectionActionable = ScrollbarSelectionActionable.WhenVisible,
Expand All @@ -115,15 +113,13 @@ fun MediaStorePage(
key = { index -> songsList[index].id },
contentType = { index -> songsList[index].id.toString() }) { index ->
val song = songsList[index]
HorizontalSongCard(
song = song,
HorizontalSongCard(song = song,
modifier = Modifier.animateItem(
fadeInSpec = null, fadeOutSpec = null
),
onClick = {
onItemClicked(song)
}
)
})
}
}
}
Expand Down

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.bobbyesp.metadator.presentation.pages.utilities.tageditor.rework
package com.bobbyesp.metadator.presentation.pages.utilities.tageditor

import android.content.res.Configuration
import android.net.Uri
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.bobbyesp.metadator.presentation.pages.utilities.tageditor.rework
package com.bobbyesp.metadator.presentation.pages.utilities.tageditor

import android.app.PendingIntent
import android.app.RecoverableSecurityException
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.bobbyesp.metadator.presentation.pages.utilities.tageditor.spotify

import android.util.Log
import androidx.compose.animation.AnimatedContent
import androidx.compose.animation.fadeIn
import androidx.compose.animation.fadeOut
Expand Down Expand Up @@ -46,6 +47,7 @@ fun SpMetadataBottomSheetContent(

LaunchedEffect(sheetState.isVisible, name, artist) {
val query = "$name $artist"
Log.i("SpMetadataBottomSheetContent", "Query: $query")
if (sheetState.isVisible && bsViewState.value.lastQuery != query) {
search(query)
}
Expand Down

0 comments on commit 88d6479

Please sign in to comment.