@@ -0,0 +1,22 @@
|
||||
using ErsatzTV.Application.ProgramSchedules;
|
||||
using ErsatzTV.Core.Scheduling;
|
||||
|
||||
namespace ErsatzTV.Controllers.Api.Requests;
|
||||
|
||||
public record CreateScheduleRequest(
|
||||
string Name,
|
||||
bool KeepMultiPartEpisodesTogether,
|
||||
bool TreatCollectionsAsShows,
|
||||
bool ShuffleScheduleItems,
|
||||
bool RandomStartPoint,
|
||||
FixedStartTimeBehavior FixedStartTimeBehavior)
|
||||
{
|
||||
public CreateProgramSchedule ToCreateCommand() =>
|
||||
new(
|
||||
Name,
|
||||
KeepMultiPartEpisodesTogether,
|
||||
TreatCollectionsAsShows,
|
||||
ShuffleScheduleItems,
|
||||
RandomStartPoint,
|
||||
FixedStartTimeBehavior);
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
using ErsatzTV.Application.ProgramSchedules;
|
||||
|
||||
namespace ErsatzTV.Controllers.Api.Requests;
|
||||
|
||||
public record ReplaceScheduleItemsRequest(List<ScheduleItemRequest> Items)
|
||||
{
|
||||
public ReplaceProgramScheduleItems ToCommand(int scheduleId) =>
|
||||
new(
|
||||
scheduleId,
|
||||
(Items ?? []).Select((item, index) => item.ToReplaceCommand(index)).ToList());
|
||||
}
|
||||
@@ -0,0 +1,127 @@
|
||||
using ErsatzTV.Application.ProgramSchedules;
|
||||
using ErsatzTV.Core.Domain;
|
||||
using ErsatzTV.Core.Scheduling;
|
||||
|
||||
namespace ErsatzTV.Controllers.Api.Requests;
|
||||
|
||||
public record ScheduleItemRequest(
|
||||
StartType StartType,
|
||||
TimeSpan? StartTime,
|
||||
FixedStartTimeBehavior? FixedStartTimeBehavior,
|
||||
PlayoutMode PlayoutMode,
|
||||
CollectionType CollectionType,
|
||||
int? CollectionId,
|
||||
int? MultiCollectionId,
|
||||
int? SmartCollectionId,
|
||||
int? RerunCollectionId,
|
||||
int? MediaItemId,
|
||||
int? PlaylistId,
|
||||
string SearchTitle,
|
||||
string SearchQuery,
|
||||
PlaybackOrder PlaybackOrder,
|
||||
MarathonGroupBy MarathonGroupBy,
|
||||
bool MarathonShuffleGroups,
|
||||
bool MarathonShuffleItems,
|
||||
int? MarathonBatchSize,
|
||||
FillWithGroupMode FillWithGroupMode,
|
||||
MultipleMode MultipleMode,
|
||||
string MultipleCount,
|
||||
TimeSpan? PlayoutDuration,
|
||||
TailMode TailMode,
|
||||
int? DiscardToFillAttempts,
|
||||
string CustomTitle,
|
||||
GuideMode GuideMode,
|
||||
int? PreRollFillerId,
|
||||
int? MidRollFillerId,
|
||||
int? PostRollFillerId,
|
||||
int? TailFillerId,
|
||||
int? FallbackFillerId,
|
||||
List<int> WatermarkIds,
|
||||
List<int> GraphicsElementIds,
|
||||
string PreferredAudioLanguageCode,
|
||||
string PreferredAudioTitle,
|
||||
string PreferredSubtitleLanguageCode,
|
||||
ChannelSubtitleMode? SubtitleMode)
|
||||
{
|
||||
public AddProgramScheduleItem ToAddCommand(int scheduleId) =>
|
||||
new(
|
||||
scheduleId,
|
||||
StartType,
|
||||
StartTime,
|
||||
FixedStartTimeBehavior,
|
||||
PlayoutMode,
|
||||
CollectionType,
|
||||
CollectionId,
|
||||
MultiCollectionId,
|
||||
SmartCollectionId,
|
||||
RerunCollectionId,
|
||||
MediaItemId,
|
||||
PlaylistId,
|
||||
SearchTitle,
|
||||
SearchQuery,
|
||||
PlaybackOrder,
|
||||
MarathonGroupBy,
|
||||
MarathonShuffleGroups,
|
||||
MarathonShuffleItems,
|
||||
MarathonBatchSize,
|
||||
FillWithGroupMode,
|
||||
MultipleMode,
|
||||
MultipleCount,
|
||||
PlayoutDuration,
|
||||
TailMode,
|
||||
DiscardToFillAttempts,
|
||||
CustomTitle,
|
||||
GuideMode,
|
||||
PreRollFillerId,
|
||||
MidRollFillerId,
|
||||
PostRollFillerId,
|
||||
TailFillerId,
|
||||
FallbackFillerId,
|
||||
WatermarkIds ?? [],
|
||||
GraphicsElementIds ?? [],
|
||||
PreferredAudioLanguageCode,
|
||||
PreferredAudioTitle,
|
||||
PreferredSubtitleLanguageCode,
|
||||
SubtitleMode);
|
||||
|
||||
public ReplaceProgramScheduleItem ToReplaceCommand(int index) =>
|
||||
new(
|
||||
index,
|
||||
StartType,
|
||||
StartTime,
|
||||
FixedStartTimeBehavior,
|
||||
PlayoutMode,
|
||||
CollectionType,
|
||||
CollectionId,
|
||||
MultiCollectionId,
|
||||
SmartCollectionId,
|
||||
RerunCollectionId,
|
||||
MediaItemId,
|
||||
PlaylistId,
|
||||
SearchTitle,
|
||||
SearchQuery,
|
||||
PlaybackOrder,
|
||||
MarathonGroupBy,
|
||||
MarathonShuffleGroups,
|
||||
MarathonShuffleItems,
|
||||
MarathonBatchSize,
|
||||
FillWithGroupMode,
|
||||
MultipleMode,
|
||||
MultipleCount,
|
||||
PlayoutDuration,
|
||||
TailMode,
|
||||
DiscardToFillAttempts,
|
||||
CustomTitle,
|
||||
GuideMode,
|
||||
PreRollFillerId,
|
||||
MidRollFillerId,
|
||||
PostRollFillerId,
|
||||
TailFillerId,
|
||||
FallbackFillerId,
|
||||
WatermarkIds ?? [],
|
||||
GraphicsElementIds ?? [],
|
||||
PreferredAudioLanguageCode,
|
||||
PreferredAudioTitle,
|
||||
PreferredSubtitleLanguageCode,
|
||||
SubtitleMode);
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
using ErsatzTV.Application.ProgramSchedules;
|
||||
using ErsatzTV.Core.Scheduling;
|
||||
|
||||
namespace ErsatzTV.Controllers.Api.Requests;
|
||||
|
||||
public record UpdateScheduleRequest(
|
||||
string Name,
|
||||
bool KeepMultiPartEpisodesTogether,
|
||||
bool TreatCollectionsAsShows,
|
||||
bool ShuffleScheduleItems,
|
||||
bool RandomStartPoint,
|
||||
FixedStartTimeBehavior FixedStartTimeBehavior)
|
||||
{
|
||||
public UpdateProgramSchedule ToCommand(int id) =>
|
||||
new(
|
||||
id,
|
||||
Name,
|
||||
KeepMultiPartEpisodesTogether,
|
||||
TreatCollectionsAsShows,
|
||||
ShuffleScheduleItems,
|
||||
RandomStartPoint,
|
||||
FixedStartTimeBehavior);
|
||||
}
|
||||
Reference in New Issue
Block a user