fix: some song lists' filtering were broken (#1865)

This commit is contained in:
Phan An 2024-10-28 15:58:20 +07:00 committed by GitHub
parent 63f2dc5241
commit b4e657686c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 10 additions and 7 deletions

View file

@ -294,7 +294,7 @@ const onPlay = async (playable: Playable) => {
const discIndexMap = computed(() => {
const map: { [key: number]: number } = {}
rows.value.forEach((row, index) => {
const { disc } = row.playable
const { disc } = row.playable as Song
if (!Object.values(map).includes(disc)) {
map[index] = disc
}

View file

@ -29,18 +29,21 @@ import ThumbnailStack from '@/components/ui/ThumbnailStack.vue'
export const useSongList = (
playables: Ref<Playable[]>,
context: PlayableListContext = {},
config: Partial<PlayableListConfig> = {
config: Partial<PlayableListConfig> = {},
) => {
const defaultConfig: PlayableListConfig = {
filterable: true,
sortable: true,
reorderable: false,
collaborative: false,
hasCustomOrderSort: false,
},
) => {
const filterKeywords = ref('')
config = reactive(config)
}
config = reactive({ ...defaultConfig, ...config })
context = reactive(context)
const filterKeywords = ref('')
const { isCurrentScreen, go, url } = useRouter()
const fuzzy = config.filterable

View file

@ -161,7 +161,7 @@ interface Song extends Playable {
album_artist_name: Artist['name']
genre: string
track: number | null
disc: number | null
disc: number
year: number | null
lyrics: string
is_public: boolean