add support for full playlist re-order (#1327)

This commit is contained in:
jeffvli
2025-12-06 17:41:10 -08:00
parent 126b5ed67d
commit 0a7029f7bc
28 changed files with 1301 additions and 59 deletions
+8 -2
View File
@@ -1,8 +1,10 @@
import { Modal as MantineModal, ModalProps as MantineModalProps } from '@mantine/core';
import { closeAllModals, ContextModalProps } from '@mantine/modals';
import {
closeAllModals as closeAllModalsMantine,
ContextModalProps,
ModalsProvider as MantineModalsProvider,
ModalsProviderProps as MantineModalsProviderProps,
openModal as openModalMantine,
} from '@mantine/modals';
import React, { ReactNode } from 'react';
@@ -15,6 +17,10 @@ import { Icon } from '/@/shared/components/icon/icon';
import { ScrollArea } from '/@/shared/components/scroll-area/scroll-area';
import { Stack } from '/@/shared/components/stack/stack';
export const openModal = openModalMantine;
export const closeAllModals = closeAllModalsMantine;
export interface ModalProps extends Omit<MantineModalProps, 'onClose'> {
children?: ReactNode;
handlers: {
@@ -106,7 +112,7 @@ export const ConfirmModal = ({
<Stack>
<Flex>{children}</Flex>
<Group justify="flex-end">
<Button onClick={handleCancel} variant="default">
<Button disabled={loading} onClick={handleCancel} variant="default">
{labels?.cancel ? labels.cancel : 'Cancel'}
</Button>
<Button
+20
View File
@@ -957,6 +957,22 @@ export type RemoveFromPlaylistQuery = {
// Remove from playlist
export type RemoveFromPlaylistResponse = null | undefined;
export type ReplacePlaylistArgs = BaseEndpointArgs & {
body: ReplacePlaylistBody;
query: ReplacePlaylistQuery;
};
export type ReplacePlaylistBody = {
songId: string[];
};
export type ReplacePlaylistQuery = {
id: string;
};
// Replace playlist
export type ReplacePlaylistResponse = null | undefined;
export type SetRatingArgs = BaseEndpointArgs & { query: RatingQuery };
export type ShareItemArgs = BaseEndpointArgs & { body: ShareItemBody };
@@ -1284,6 +1300,7 @@ export type ControllerEndpoint = {
getUserList?: (args: UserListArgs) => Promise<UserListResponse>;
movePlaylistItem?: (args: MoveItemArgs) => Promise<void>;
removeFromPlaylist: (args: RemoveFromPlaylistArgs) => Promise<RemoveFromPlaylistResponse>;
replacePlaylist: (args: ReplacePlaylistArgs) => Promise<ReplacePlaylistResponse>;
scrobble: (args: ScrobbleArgs) => Promise<ScrobbleResponse>;
search: (args: SearchArgs) => Promise<SearchResponse>;
setRating?: (args: SetRatingArgs) => Promise<RatingResponse>;
@@ -1379,6 +1396,9 @@ export type InternalControllerEndpoint = {
removeFromPlaylist: (
args: ReplaceApiClientProps<RemoveFromPlaylistArgs>,
) => Promise<RemoveFromPlaylistResponse>;
replacePlaylist: (
args: ReplaceApiClientProps<ReplacePlaylistArgs>,
) => Promise<ReplacePlaylistResponse>;
scrobble: (args: ReplaceApiClientProps<ScrobbleArgs>) => Promise<ScrobbleResponse>;
search: (args: ReplaceApiClientProps<SearchArgs>) => Promise<SearchResponse>;
setRating?: (args: ReplaceApiClientProps<SetRatingArgs>) => Promise<RatingResponse>;
+1
View File
@@ -177,6 +177,7 @@ export enum TableColumn {
OWNER = 'username',
PATH = 'path',
PLAY_COUNT = 'playCount',
PLAYLIST_REORDER = 'playlistReorder',
RELEASE_DATE = 'releaseDate',
ROW_INDEX = 'rowIndex',
SIZE = 'size',