mirror of
https://github.com/koel/koel
synced 2024-11-14 16:37:28 +00:00
fix: some song lists' filtering were broken (#1865)
This commit is contained in:
parent
63f2dc5241
commit
b4e657686c
3 changed files with 10 additions and 7 deletions
|
@ -294,7 +294,7 @@ const onPlay = async (playable: Playable) => {
|
||||||
const discIndexMap = computed(() => {
|
const discIndexMap = computed(() => {
|
||||||
const map: { [key: number]: number } = {}
|
const map: { [key: number]: number } = {}
|
||||||
rows.value.forEach((row, index) => {
|
rows.value.forEach((row, index) => {
|
||||||
const { disc } = row.playable
|
const { disc } = row.playable as Song
|
||||||
if (!Object.values(map).includes(disc)) {
|
if (!Object.values(map).includes(disc)) {
|
||||||
map[index] = disc
|
map[index] = disc
|
||||||
}
|
}
|
||||||
|
|
|
@ -29,18 +29,21 @@ import ThumbnailStack from '@/components/ui/ThumbnailStack.vue'
|
||||||
export const useSongList = (
|
export const useSongList = (
|
||||||
playables: Ref<Playable[]>,
|
playables: Ref<Playable[]>,
|
||||||
context: PlayableListContext = {},
|
context: PlayableListContext = {},
|
||||||
config: Partial<PlayableListConfig> = {
|
config: Partial<PlayableListConfig> = {},
|
||||||
|
) => {
|
||||||
|
const defaultConfig: PlayableListConfig = {
|
||||||
filterable: true,
|
filterable: true,
|
||||||
sortable: true,
|
sortable: true,
|
||||||
reorderable: false,
|
reorderable: false,
|
||||||
collaborative: false,
|
collaborative: false,
|
||||||
hasCustomOrderSort: false,
|
hasCustomOrderSort: false,
|
||||||
},
|
}
|
||||||
) => {
|
|
||||||
const filterKeywords = ref('')
|
config = reactive({ ...defaultConfig, ...config })
|
||||||
config = reactive(config)
|
|
||||||
context = reactive(context)
|
context = reactive(context)
|
||||||
|
|
||||||
|
const filterKeywords = ref('')
|
||||||
|
|
||||||
const { isCurrentScreen, go, url } = useRouter()
|
const { isCurrentScreen, go, url } = useRouter()
|
||||||
|
|
||||||
const fuzzy = config.filterable
|
const fuzzy = config.filterable
|
||||||
|
|
2
resources/assets/js/types.d.ts
vendored
2
resources/assets/js/types.d.ts
vendored
|
@ -161,7 +161,7 @@ interface Song extends Playable {
|
||||||
album_artist_name: Artist['name']
|
album_artist_name: Artist['name']
|
||||||
genre: string
|
genre: string
|
||||||
track: number | null
|
track: number | null
|
||||||
disc: number | null
|
disc: number
|
||||||
year: number | null
|
year: number | null
|
||||||
lyrics: string
|
lyrics: string
|
||||||
is_public: boolean
|
is_public: boolean
|
||||||
|
|
Loading…
Reference in a new issue