feat: remove, copy and reorder several playlist songs at once

This commit is contained in:
DiheChen committed 2026-11-09 21:28:12 +08:00
1 parent fafde9041c
commit 2657dca9e1
34 files changed
+1578 -92

No files matched your search

@@ -11,6 +11,14 @@ location ^~ /api/ {
client_body_buffer_size 64k;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_pass http://$serve;
# 取值必须不小于 serve 对批量歌单接口的请求体上限 maxBatchBodyBytes(2304000 字节),否则大请求会被 nginx 以 HTML 的 413 拒绝,或写入临时文件。
location ~ ^/api/me/playlists/[^/]+/(removals|copies|moves)$ {
client_max_body_size 2250k;
client_body_buffer_size 2250k;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_pass http://$serve;
}
}
location ^~ /media/ {
proxy_pass http://$serve;
+19 -3
View File
@@ -109,6 +109,15 @@ export interface ChangePasswordRequest {
newPassword: string
}
export interface CopyMyPlaylistItemsRequest {
from: string
tracks: Track[]
}
export interface CopyMyPlaylistItemsResponse {
added: number
}
export type CreateMemberRequest = Record<string, never>
export interface CreateMemberResponse {
@@ -173,6 +182,11 @@ export interface LoginResponse {
memberToken: string
}
export interface MoveMyPlaylistItemsRequest {
before?: Track
tracks: Track[]
}
export interface RegisterRequest {
password: string
username: string
@@ -182,8 +196,8 @@ export interface RegisterResponse {
account: Account
}
export interface RemoveMyPlaylistItemRequest {
track: Track
export interface RemoveMyPlaylistItemsRequest {
tracks: Track[]
}
export interface RenameMyPlaylistRequest {
@@ -229,7 +243,9 @@ export function httpClient(send: HttpSend) {
deleteMyPlaylist: (id: string) => send<void>({ method: 'DELETE', path: `/api/me/playlists/${encodeURIComponent(id)}`, auth: 'member' }),
listMyPlaylistItems: (id: string) => send<ListMyPlaylistItemsResponse>({ method: 'GET', path: `/api/me/playlists/${encodeURIComponent(id)}/items`, auth: 'member' }),
addMyPlaylistItem: (id: string, body: AddMyPlaylistItemRequest) => send<AddMyPlaylistItemResponse>({ method: 'POST', path: `/api/me/playlists/${encodeURIComponent(id)}/items`, auth: 'member', body }),
removeMyPlaylistItem: (id: string, body: RemoveMyPlaylistItemRequest) => send<void>({ method: 'POST', path: `/api/me/playlists/${encodeURIComponent(id)}/removals`, auth: 'member', body }),
removeMyPlaylistItems: (id: string, body: RemoveMyPlaylistItemsRequest) => send<void>({ method: 'POST', path: `/api/me/playlists/${encodeURIComponent(id)}/removals`, auth: 'member', body }),
copyMyPlaylistItems: (id: string, body: CopyMyPlaylistItemsRequest) => send<CopyMyPlaylistItemsResponse>({ method: 'POST', path: `/api/me/playlists/${encodeURIComponent(id)}/copies`, auth: 'member', body }),
moveMyPlaylistItems: (id: string, body: MoveMyPlaylistItemsRequest) => send<void>({ method: 'POST', path: `/api/me/playlists/${encodeURIComponent(id)}/moves`, auth: 'member', body }),
listRooms: () => send<ListRoomsResponse>({ method: 'GET', path: '/api/rooms', auth: 'none' }),
getRoom: (ref: string) => send<RoomListing>({ method: 'GET', path: `/api/rooms/${encodeURIComponent(ref)}`, auth: 'none' }),
createRoom: (body: CreateRoomRequest) => send<CreateRoomResponse>({ method: 'POST', path: '/api/rooms', auth: 'none', body }),
+1 -1
View File
@@ -1,6 +1,6 @@
// Code generated by protocolgen from protocol/idl.json; DO NOT EDIT.
export const PROTOCOL_VERSION = '7380d77bc52d7f95'
export const PROTOCOL_VERSION = '1b53e1e08b0452e4'
export interface APIKey {
key: string