mirror of
https://github.com/truewhile/MeBox.git
synced 2026-09-29 19:36:36 +08:00
Remove unused recycle bin and add optional local file delete (#26)
Soft-delete restore/purge/list and the recycle_purge job are gone. Admin delete now removes library index rows, with an optional delete_files query that also deletes local media + sidecar NFO. UI copy is renamed from 移入回收站 to 删除, with a confirm checkbox. Co-authored-by: Cursor Agent <cursoragent@cursor.com> Co-authored-by: truewhile <truewhile@users.noreply.github.com>
This commit is contained in:
@@ -225,6 +225,19 @@ export const mediaAPI = {
|
||||
{ timeout: BATCH_REQUEST_TIMEOUT },
|
||||
)
|
||||
.then((r) => r.data),
|
||||
|
||||
delete: (id: string, options?: { deleteFiles?: boolean }) =>
|
||||
api
|
||||
.delete(`/media/${id}`, {
|
||||
params: options?.deleteFiles ? { delete_files: true } : undefined,
|
||||
})
|
||||
.then((r) => r.data),
|
||||
|
||||
exportNFO: (id: string) =>
|
||||
api.post<{ path: string }>(`/media/${id}/nfo`).then((r) => r.data),
|
||||
|
||||
exportLibraryNFO: (id: string) =>
|
||||
api.post<{ written: number }>(`/libraries/${id}/nfo`).then((r) => r.data),
|
||||
}
|
||||
|
||||
function episodeImageOption(options?: ScrapeOptions): boolean | undefined {
|
||||
|
||||
@@ -1,15 +0,0 @@
|
||||
import { api } from './client'
|
||||
|
||||
export const recycleAPI = {
|
||||
softDelete: (id: string) => api.delete(`/media/${id}`).then((r) => r.data),
|
||||
|
||||
restore: (id: string) => api.post(`/media/${id}/restore`).then((r) => r.data),
|
||||
|
||||
purge: (id: string) => api.delete(`/media/${id}/purge`).then((r) => r.data),
|
||||
|
||||
exportNFO: (id: string) =>
|
||||
api.post<{ path: string }>(`/media/${id}/nfo`).then((r) => r.data),
|
||||
|
||||
exportLibraryNFO: (id: string) =>
|
||||
api.post<{ written: number }>(`/libraries/${id}/nfo`).then((r) => r.data),
|
||||
}
|
||||
Reference in New Issue
Block a user