mirror of
https://github.com/jeffvli/feishin.git
synced 2026-07-08 19:50:12 +02:00
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:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user