Fix scraping workflows subscriptions bot and recycle bin

This commit is contained in:
ShukeBta
2026-06-17 19:48:17 +08:00
parent 91afbe54a2
commit 850d3db811
43 changed files with 2782 additions and 76 deletions
+29
View File
@@ -15,6 +15,24 @@ export interface MediaSearchPage {
page_size?: number
}
export interface ManualScrapeCandidate {
source: string
media_type?: string
title: string
overview?: string
poster_url?: string
backdrop_url?: string
year?: number
rating?: number
tmdb_id?: number
bangumi_id?: number
douban_id?: string
thetvdb_id?: string
languages?: string[]
countries?: string[]
genres?: string[]
}
export const libraryAPI = {
list: (options?: { includeHidden?: boolean }) =>
api
@@ -56,4 +74,15 @@ export const mediaAPI = {
.then((r) => r.data),
get: (id: string) => api.get<Media>(`/media/${id}`).then((r) => r.data),
manualScrapeSearch: (id: string, params: { query: string; provider?: string; media_type?: string }) =>
api
.get<{ items: ManualScrapeCandidate[] }>(`/media/${id}/scrape/search`, { params })
.then((r) => r.data.items),
applyManualScrape: (id: string, match: ManualScrapeCandidate) =>
api.post<Media>(`/media/${id}/scrape/apply`, match).then((r) => r.data),
applyManualScrapeBatch: (mediaIDs: string[], match: ManualScrapeCandidate) =>
api.post<{ applied: number; errors?: string[] }>('/media/scrape/apply', { media_ids: mediaIDs, match }).then((r) => r.data),
}
+12
View File
@@ -26,4 +26,16 @@ export const notifyChannelsAPI = {
test: (id: string) =>
api.post<{ message: string }>(`/admin/notify/channels/${id}/test`).then((r) => r.data),
startTelegramPolling: () =>
api.post<{
message: string
started: number
already_running: number
skipped: number
errors?: string[]
}>('/admin/telegram/polling/start').then((r) => r.data),
stopTelegramPolling: () =>
api.post<{ message: string; stopped: number }>('/admin/telegram/polling/stop').then((r) => r.data),
}
+6
View File
@@ -8,8 +8,14 @@ export const recycleAPI = {
restore: (id: string) => api.post(`/media/${id}/restore`).then((r) => r.data),
restoreMany: (ids: string[]) =>
api.post<{ applied: number; errors?: string[] }>('/recycle/restore', { media_ids: ids }).then((r) => r.data),
purge: (id: string) => api.delete(`/media/${id}/purge`).then((r) => r.data),
purgeMany: (ids: string[]) =>
api.post<{ applied: number; errors?: string[] }>('/recycle/purge', { media_ids: ids }).then((r) => r.data),
exportNFO: (id: string) =>
api.post<{ path: string }>(`/media/${id}/nfo`).then((r) => r.data),