refactor song path replacement

- path replacement during runtime instead of during API normalization
- fix Navidrome API path not appending libraryPath which caused inconsistency between ND and Subsonic paths
This commit is contained in:
jeffvli
2026-06-19 22:02:12 -07:00
parent 36624350f6
commit 61cc87e0b7
15 changed files with 119 additions and 398 deletions
@@ -4,6 +4,7 @@ import { useTranslation } from 'react-i18next';
import { ContextMenu } from '/@/shared/components/context-menu/context-menu';
import { toast } from '/@/shared/components/toast/toast';
import { resolveSongPath } from '/@/renderer/utils/resolve-song-path';
import { QueueSong, Song } from '/@/shared/types/domain-types';
interface ShowInFileExplorerActionProps {
@@ -21,12 +22,13 @@ export const ShowInFileExplorerAction = ({ items }: ShowInFileExplorerActionProp
}
const firstItem = items[0];
if (!firstItem?.path) {
const resolvedPath = resolveSongPath(firstItem?.path);
if (!resolvedPath) {
return;
}
try {
await utils.openItem(firstItem.path);
await utils.openItem(resolvedPath);
} catch (error) {
toast.error({
message: (error as Error).message,