mirror of
https://github.com/MrPatben8/konduktor.git
synced 2026-11-27 10:22:51 +01:00
Track tags are now refreshed correctly when editing from within an export folder
This commit is contained in:
1 parent
86b26e3229
commit
bd35418a89
5 files changed
+32
-24
No files matched your search
@@ -4,6 +4,7 @@ import { useQuery, useQueryClient } from '@tanstack/react-query'
|
||||
import { api, type RemapPreview } from '../api'
|
||||
import type { ToastMsg } from './Toast'
|
||||
import { Icon } from '../lib/icons'
|
||||
import { invalidateTrackLists } from '../lib/trackQueries'
|
||||
|
||||
interface Props {
|
||||
onClose: () => void
|
||||
@@ -65,7 +66,7 @@ export function PathMappingDialog({ onClose, onNotify, onError }: Props) {
|
||||
await api.putPathMapping({ from: from.trim(), to: to.trim() })
|
||||
// Re-resolve everything that depends on the file path.
|
||||
qc.invalidateQueries({ queryKey: ['pathMapping'] })
|
||||
qc.invalidateQueries({ queryKey: ['tracks'] })
|
||||
invalidateTrackLists(qc)
|
||||
const cleared = !from.trim() || !to.trim()
|
||||
onNotify('success', cleared ? 'Path mapping cleared.' : 'Path mapping saved.')
|
||||
onClose()
|
||||
@@ -81,8 +82,8 @@ export function PathMappingDialog({ onClose, onNotify, onError }: Props) {
|
||||
try {
|
||||
const res = await api.remapPaths(from.trim(), to.trim())
|
||||
// Locations changed, so track ids changed — refetch library + state.
|
||||
qc.invalidateQueries({ queryKey: ['tracks'] })
|
||||
qc.invalidateQueries({ queryKey: ['state'] })
|
||||
invalidateTrackLists(qc)
|
||||
qc.invalidateQueries({ queryKey: ['export-contents'] })
|
||||
if (res.rewritten === 0) {
|
||||
onNotify('warning', 'No tracks matched — nothing was rewritten.')
|
||||
} else {
|
||||
|
||||
Reference in new issue
Block a user