Implement bulk tagging and enriching of shows with new API endpoints and frontend integration
Added new API endpoints for bulk tagging and enriching shows, allowing for mass updates of genres and audience ratings. Implemented backend logic to handle bulk operations and updated the Dependency Injection configuration to include necessary services. Enhanced the frontend with new components for selecting shows and applying bulk actions, improving the user experience for managing multiple shows simultaneously. Localization updates were made to support these new features in both English and Russian.
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import { apiRequest } from '@/shared/api/client'
|
||||
import type {
|
||||
CreatedIdResponse,
|
||||
EnrichShowsResult,
|
||||
MetadataCandidate,
|
||||
MissingEpisodesReport,
|
||||
MissingSeasonsReport,
|
||||
@@ -53,6 +54,25 @@ export function setShowOriginalName(id: string, originalName: string | null) {
|
||||
})
|
||||
}
|
||||
|
||||
/** Массовая разметка отмеченных шоу: жанры и рейтинг применяются независимо. */
|
||||
export function bulkTagShows(body: {
|
||||
showIds: string[]
|
||||
genreIds?: string[]
|
||||
replaceGenres?: boolean
|
||||
audience?: ShowAudience | null
|
||||
setAudience?: boolean
|
||||
}) {
|
||||
return apiRequest<{ updated: number }>('/admin/shows/bulk/tag', { method: 'POST', body })
|
||||
}
|
||||
|
||||
/** Массовое обогащение: найти метаданные по названию и применить тем, у кого нет привязки. */
|
||||
export function bulkEnrichShows(showIds: string[], provider: string) {
|
||||
return apiRequest<EnrichShowsResult>('/admin/shows/bulk/enrich', {
|
||||
method: 'POST',
|
||||
body: { showIds, provider },
|
||||
})
|
||||
}
|
||||
|
||||
export function deleteShow(id: string) {
|
||||
return apiRequest<void>(`/admin/shows/${id}`, { method: 'DELETE' })
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user