Refactor bumper template background management: rename background upload endpoint to reflect new functionality, update related command and handler to use image ID instead of extension, and adjust data models to support image references. Remove obsolete background handling code and enhance UI components for improved image selection and display.

This commit is contained in:
Leonid Pershin committed 2026-07-25 11:56:36 +03:00
1 parent a970eae7d2
commit 7efd616c29
35 files changed
+1227 -279

No files matched your search

@@ -18,7 +18,8 @@ import {
} from '@/features/admin/media/episode-parse'
import { formatDuration } from '@/features/admin/media/MediaPanel'
import { ShowMetadataCard } from './ShowMetadataCard'
import { addEpisode, episodeStillUrl, getShow, removeEpisode } from './api'
import { imageUrl } from '@/features/admin/images/api'
import { addEpisode, getShow, removeEpisode } from './api'
type Candidate = { asset: MediaAssetDto; parsed: ParsedEpisode }
@@ -219,9 +220,9 @@ export function ShowDetail({ showId }: { showId: string }) {
<td className="px-4 py-2 text-muted-foreground">{index + 1}</td>
<td className="px-4 py-2">
<div className="flex items-center gap-2">
{episode.hasStill && (
{episode.stillImageId && (
<img
src={episodeStillUrl(episode.id)}
src={imageUrl(episode.stillImageId)}
alt=""
className="h-9 w-16 shrink-0 rounded object-cover"
/>
-5
View File
@@ -80,11 +80,6 @@ export function setShowPoster(showId: string, imageId: string | null) {
})
}
/** Ссылка на локальный кадр серии. */
export function episodeStillUrl(episodeId: string, bust?: string) {
return `/api/metadata/episodes/${episodeId}/still${bust ? `?v=${encodeURIComponent(bust)}` : ''}`
}
/** Довыгрузить метаданные серий из привязанного источника. Возвращает число обновлённых. */
export function refreshEpisodesMetadata(showId: string) {
return apiRequest<number>(`/admin/metadata/shows/${showId}/refresh-episodes`, { method: 'POST' })