mirror of
https://github.com/antebudimir/feishin.git
synced 2026-01-02 10:53:33 +00:00
enable reordering non-smart playlists
This commit is contained in:
parent
0b383b758e
commit
10fca2dc12
11 changed files with 148 additions and 0 deletions
|
|
@ -53,6 +53,7 @@ import {
|
|||
ServerInfoArgs,
|
||||
SimilarSongsArgs,
|
||||
Song,
|
||||
MoveItemArgs,
|
||||
} from '/@/renderer/api/types';
|
||||
import { jfApiClient } from '/@/renderer/api/jellyfin/jellyfin-api';
|
||||
import { jfNormalize } from './jellyfin-normalize';
|
||||
|
|
@ -1025,6 +1026,23 @@ const getSimilarSongs = async (args: SimilarSongsArgs): Promise<Song[]> => {
|
|||
}, []);
|
||||
};
|
||||
|
||||
const movePlaylistItem = async (args: MoveItemArgs): Promise<void> => {
|
||||
const { apiClientProps, query } = args;
|
||||
|
||||
const res = await jfApiClient(apiClientProps).movePlaylistItem({
|
||||
body: null,
|
||||
params: {
|
||||
itemId: query.trackId,
|
||||
newIdx: query.endingIndex.toString(),
|
||||
playlistId: query.playlistId,
|
||||
},
|
||||
});
|
||||
|
||||
if (res.status !== 204) {
|
||||
throw new Error('Failed to move item in playlist');
|
||||
}
|
||||
};
|
||||
|
||||
export const jfController = {
|
||||
addToPlaylist,
|
||||
authenticate,
|
||||
|
|
@ -1049,6 +1067,7 @@ export const jfController = {
|
|||
getSongDetail,
|
||||
getSongList,
|
||||
getTopSongList,
|
||||
movePlaylistItem,
|
||||
removeFromPlaylist,
|
||||
scrobble,
|
||||
search,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue