Refactor .gitignore to streamline ignored files and enhance clarity. Update CLAUDE.md to improve unit test instructions and add coverage reporting details. Revise README.md for better project overview and deployment instructions. Refactor ChannelEndpoints and StreamingEndpoints to utilize SegmentFiles for file resolution, improving code maintainability. Remove unused JunctionHandlers and update DependencyInjection for cleaner service registration. Enhance media processing services for better job handling and error management. Update frontend API types for consistency and clarity.
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
import { create } from 'zustand'
|
||||
import { qk } from '@/shared/api/query-keys'
|
||||
import { HttpError, refreshAccessToken } from '@/shared/api/client'
|
||||
import { queryClient } from '@/shared/api/query-client'
|
||||
import { importInterstitials } from '@/features/admin/interstitials/api'
|
||||
@@ -31,7 +32,7 @@ type UploadStore = {
|
||||
* <c>showId</c> — общий для всех файлов; <c>resolveShowId</c> — привязка на каждый файл (напр.
|
||||
* автоопределение шоу по имени релиза). Приоритет у <c>resolveShowId</c>, затем общий <c>showId</c>.
|
||||
*/
|
||||
export type EnqueueOptions = {
|
||||
type EnqueueOptions = {
|
||||
showId?: string
|
||||
resolveShowId?: (file: File) => string | undefined
|
||||
/** Загрузка с экрана «Ролики»: каждый файл после аплоада становится роликом (Show + серия). */
|
||||
@@ -105,13 +106,13 @@ async function pump() {
|
||||
|
||||
if (created) {
|
||||
patch(job.id, { status: 'done', percent: 100 })
|
||||
void queryClient.invalidateQueries({ queryKey: ['admin', 'media'] })
|
||||
void queryClient.invalidateQueries({ queryKey: qk.media.all })
|
||||
|
||||
// Привязка к шоу: добавляем свежий ассет серией (порядок — как в очереди).
|
||||
if (job.showId) {
|
||||
try {
|
||||
await addEpisode(job.showId, created.id)
|
||||
void queryClient.invalidateQueries({ queryKey: ['admin', 'shows'] })
|
||||
void queryClient.invalidateQueries({ queryKey: qk.shows.all })
|
||||
} catch {
|
||||
toast.error(`${job.file.name}: не удалось добавить в шоу`)
|
||||
}
|
||||
@@ -119,7 +120,7 @@ async function pump() {
|
||||
// Ролик заводится сразу после аплоада: длительность подтянется, когда ассет обработается.
|
||||
try {
|
||||
await importInterstitials([created.id])
|
||||
void queryClient.invalidateQueries({ queryKey: ['admin', 'interstitials'] })
|
||||
void queryClient.invalidateQueries({ queryKey: qk.interstitials.all })
|
||||
} catch {
|
||||
toast.error(`${job.file.name}: не удалось завести ролик`)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user