Implement image management enhancements: add functionality to relocate legacy images during startup, update image handling in show metadata, and refactor related API endpoints to utilize the new image storage system. Adjust database schema to support image references and update UI components for improved image selection and display.
This commit is contained in:
@@ -41,7 +41,7 @@ public sealed class GetPublicEpgQueryHandler(IAppDbContext dbContext)
|
||||
var showIds = entries.Where(e => e.ShowId != null).Select(e => e.ShowId!.Value).Distinct().ToList();
|
||||
var shows = await dbContext.Shows.AsNoTracking()
|
||||
.Where(s => showIds.Contains(s.Id))
|
||||
.Select(s => new { s.Id, s.Name, s.PosterPath })
|
||||
.Select(s => new { s.Id, s.Name, s.PosterImageId })
|
||||
.ToDictionaryAsync(s => s.Id, cancellationToken);
|
||||
|
||||
// Метаданные серий: ключ — (шоу, ассет).
|
||||
@@ -78,7 +78,7 @@ public sealed class GetPublicEpgQueryHandler(IAppDbContext dbContext)
|
||||
e.EndsAtUtc,
|
||||
e.ShowId,
|
||||
show?.Name,
|
||||
show?.PosterPath is not null,
|
||||
show?.PosterImageId,
|
||||
episode?.Id,
|
||||
episode?.Title,
|
||||
episode?.Overview,
|
||||
|
||||
+2
-2
@@ -42,7 +42,7 @@ public sealed class ListPublicChannelsQueryHandler(IAppDbContext dbContext)
|
||||
var showIds = currentShowByChannel.Values.Distinct().ToList();
|
||||
var shows = await dbContext.Shows.AsNoTracking()
|
||||
.Where(s => showIds.Contains(s.Id))
|
||||
.Select(s => new { s.Id, s.Name, s.PosterPath })
|
||||
.Select(s => new { s.Id, s.Name, s.PosterImageId })
|
||||
.ToDictionaryAsync(s => s.Id, cancellationToken);
|
||||
|
||||
return channels
|
||||
@@ -56,7 +56,7 @@ public sealed class ListPublicChannelsQueryHandler(IAppDbContext dbContext)
|
||||
c.Name,
|
||||
show is null ? null : showId,
|
||||
show?.Name,
|
||||
show?.PosterPath is not null
|
||||
show?.PosterImageId
|
||||
);
|
||||
})
|
||||
.ToList();
|
||||
|
||||
@@ -8,7 +8,7 @@ public sealed record PublicChannelDto(
|
||||
string Name,
|
||||
Guid? CurrentShowId,
|
||||
string? CurrentShowName,
|
||||
bool CurrentShowHasPoster
|
||||
Guid? CurrentShowPosterImageId
|
||||
);
|
||||
|
||||
/// <summary>Запись публичного телегида с метаданными (без имён файлов и номеров серий).</summary>
|
||||
@@ -18,7 +18,7 @@ public sealed record PublicEpgEntryDto(
|
||||
DateTimeOffset EndsAtUtc,
|
||||
Guid? ShowId,
|
||||
string? ShowName,
|
||||
bool ShowHasPoster,
|
||||
Guid? ShowPosterImageId,
|
||||
Guid? EpisodeId,
|
||||
string? EpisodeTitle,
|
||||
string? EpisodeOverview,
|
||||
|
||||
Reference in New Issue
Block a user