mirror of
https://github.com/jeffvli/feishin.git
synced 2026-07-21 18:06:30 +02:00
Use resolveSongPath in use-metadata-editor
This commit is contained in:
@@ -14,6 +14,7 @@ import { base64ToBytes, formatBatchFileErrors } from '../utils/utils';
|
|||||||
|
|
||||||
import { controller } from '/@/renderer/api/controller';
|
import { controller } from '/@/renderer/api/controller';
|
||||||
import { useCurrentServer } from '/@/renderer/store';
|
import { useCurrentServer } from '/@/renderer/store';
|
||||||
|
import { resolveSongPath } from '/@/renderer/utils/resolve-song-path';
|
||||||
import { toast } from '/@/shared/components/toast/toast';
|
import { toast } from '/@/shared/components/toast/toast';
|
||||||
import { Song } from '/@/shared/types/domain-types';
|
import { Song } from '/@/shared/types/domain-types';
|
||||||
|
|
||||||
@@ -121,7 +122,7 @@ export const useMetadataEditor = ({ browser, songs: songsProp, utils }: UseMetad
|
|||||||
}
|
}
|
||||||
|
|
||||||
setResolvedSongs(songs);
|
setResolvedSongs(songs);
|
||||||
const paths = songs.map((s) => s.path!);
|
const paths = songs.map((s) => resolveSongPath(s.path)).filter(Boolean) as string[];
|
||||||
|
|
||||||
const batchResult = await withBatchProgress(utils, setLoadProgress, () =>
|
const batchResult = await withBatchProgress(utils, setLoadProgress, () =>
|
||||||
utils.readSongMetadataBatch(paths),
|
utils.readSongMetadataBatch(paths),
|
||||||
@@ -261,7 +262,7 @@ export const useMetadataEditor = ({ browser, songs: songsProp, utils }: UseMetad
|
|||||||
}
|
}
|
||||||
|
|
||||||
setIsSaving(true);
|
setIsSaving(true);
|
||||||
const paths = resolvedSongs.map((s) => s.path!).filter(Boolean);
|
const paths = resolvedSongs.map((s) => resolveSongPath(s.path)).filter(Boolean) as string[];
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const writeResult = await withBatchProgress(utils, setLoadProgress, () =>
|
const writeResult = await withBatchProgress(utils, setLoadProgress, () =>
|
||||||
|
|||||||
Reference in New Issue
Block a user