Enhance show management: add OriginalName property to ShowSummaryDto, update ListShowsQueryHandler to include OriginalName, and improve upload functionality by allowing auto-detection of shows based on file names. Update translations for better user guidance on show detection.

This commit is contained in:
Leonid Pershin
2026-07-25 18:54:43 +03:00
parent 8718e8b6bf
commit 9cefc6a198
7 changed files with 113 additions and 31 deletions
@@ -25,8 +25,15 @@ type UploadStore = {
dismiss: () => void
}
/** Доп-опции загрузки: привязка загружаемых файлов к шоу (добавляются сериями после аплоада). */
export type EnqueueOptions = { showId?: string }
/**
* Доп-опции загрузки: привязка загружаемых файлов к шоу (добавляются сериями после аплоада).
* <c>showId</c> — общий для всех файлов; <c>resolveShowId</c> — привязка на каждый файл (напр.
* автоопределение шоу по имени релиза). Приоритет у <c>resolveShowId</c>, затем общий <c>showId</c>.
*/
export type EnqueueOptions = {
showId?: string
resolveShowId?: (file: File) => string | undefined
}
// Очередь и флаг живут вне React — загрузка продолжается при любой навигации.
let counter = 0
@@ -149,7 +156,8 @@ export const useUploadStore = create<UploadStore>((set) => ({
const newItems: UploadItem[] = toAdd.map((file) => {
const id = `u${++counter}`
queue.push({ id, file, showId: options?.showId })
const showId = options?.resolveShowId?.(file) ?? options?.showId
queue.push({ id, file, showId })
return { id, name: file.name, percent: 0, status: 'queued' }
})