Refactor various components to improve code clarity and maintainability. Update ListUsersQueryHandler to utilize UserListFilter for parameter handling. Refactor BumperSpecFactory and related classes to encapsulate input parameters into dedicated records, enhancing readability. Adjust MediaAsset and Slot classes to streamline content updates with new content models. Improve BumperRenderBackgroundService and MediaProcessingBackgroundService to use MediaReadyInfo for asset readiness, ensuring consistent parameter management across the application.
This commit is contained in:
@@ -28,7 +28,12 @@ public class BumperTextVariantTests
|
||||
{
|
||||
var v = NewVariant();
|
||||
|
||||
v.Update("Name", BumperTextKind.Free, "NOW", "NEXT", "l1", "l2", BumperTrigger.Both, -5);
|
||||
v.Update(
|
||||
"Name",
|
||||
new BumperTextContent(BumperTextKind.Free, "NOW", "NEXT", "l1", "l2"),
|
||||
BumperTrigger.Both,
|
||||
-5
|
||||
);
|
||||
|
||||
Assert.Equal("Name", v.Name);
|
||||
Assert.Equal(BumperTextKind.Free, v.Kind);
|
||||
@@ -48,7 +53,7 @@ public class BumperTextVariantTests
|
||||
public void Matches_FollowsTrigger(BumperTrigger trigger, bool isShowChange, bool expected)
|
||||
{
|
||||
var v = NewVariant();
|
||||
v.Update("n", BumperTextKind.NowNext, "a", "b", "", "", trigger, 1);
|
||||
v.Update("n", new BumperTextContent(BumperTextKind.NowNext, "a", "b", "", ""), trigger, 1);
|
||||
|
||||
Assert.Equal(expected, v.Matches(isShowChange));
|
||||
}
|
||||
|
||||
@@ -35,14 +35,16 @@ public class MediaAssetTests
|
||||
var asset = MediaAsset.Register("a.mp4", ".mp4", MediaSource.Upload);
|
||||
|
||||
asset.MarkReady(
|
||||
TimeSpan.FromSeconds(120),
|
||||
segmentSeconds: 2,
|
||||
segmentCount: 60,
|
||||
width: 1920,
|
||||
height: 1080,
|
||||
videoCodec: "h264",
|
||||
audioCodec: "aac",
|
||||
relativePath: "assets/abc"
|
||||
new MediaReadyInfo(
|
||||
TimeSpan.FromSeconds(120),
|
||||
SegmentSeconds: 2,
|
||||
SegmentCount: 60,
|
||||
Width: 1920,
|
||||
Height: 1080,
|
||||
VideoCodec: "h264",
|
||||
AudioCodec: "aac",
|
||||
RelativePath: "assets/abc"
|
||||
)
|
||||
);
|
||||
|
||||
Assert.Equal(MediaAssetStatus.Ready, asset.Status);
|
||||
@@ -64,7 +66,9 @@ public class MediaAssetTests
|
||||
Assert.NotNull(asset.ProcessingStartedAt);
|
||||
Assert.Null(asset.ProcessingDuration);
|
||||
|
||||
asset.MarkReady(TimeSpan.FromSeconds(120), 2, 60, 1920, 1080, "h264", "aac", "assets/abc");
|
||||
asset.MarkReady(
|
||||
new MediaReadyInfo(TimeSpan.FromSeconds(120), 2, 60, 1920, 1080, "h264", "aac", "assets/abc")
|
||||
);
|
||||
|
||||
Assert.NotNull(asset.ProcessingDuration);
|
||||
Assert.True(asset.ProcessingDuration >= TimeSpan.Zero);
|
||||
@@ -75,7 +79,9 @@ public class MediaAssetTests
|
||||
{
|
||||
var asset = MediaAsset.Register("a.mp4", ".mp4", MediaSource.Upload);
|
||||
|
||||
asset.MarkReady(TimeSpan.FromSeconds(120), 2, 60, 1920, 1080, "h264", "aac", "assets/abc");
|
||||
asset.MarkReady(
|
||||
new MediaReadyInfo(TimeSpan.FromSeconds(120), 2, 60, 1920, 1080, "h264", "aac", "assets/abc")
|
||||
);
|
||||
|
||||
Assert.Null(asset.ProcessingDuration);
|
||||
}
|
||||
|
||||
@@ -113,25 +113,29 @@ public class GridLayerOverlapTests
|
||||
var layer = NewLayer();
|
||||
var slot = layer.AddSlot("Кино", new TimeOnly(20, 0), 90);
|
||||
slot.UpdateContent(
|
||||
"Кино",
|
||||
SlotKind.Content,
|
||||
Guid.NewGuid(),
|
||||
"{\"type\":\"sequential\"}",
|
||||
null,
|
||||
SlotBlockMode.Count,
|
||||
1,
|
||||
OverflowPolicy.ContinueNext
|
||||
new SlotContent(
|
||||
"Кино",
|
||||
SlotKind.Content,
|
||||
Guid.NewGuid(),
|
||||
"{\"type\":\"sequential\"}",
|
||||
null,
|
||||
SlotBlockMode.Count,
|
||||
1,
|
||||
OverflowPolicy.ContinueNext
|
||||
)
|
||||
);
|
||||
|
||||
slot.UpdateContent(
|
||||
"Конец вещания",
|
||||
SlotKind.SignOff,
|
||||
Guid.NewGuid(),
|
||||
"{\"type\":\"sequential\"}",
|
||||
null,
|
||||
SlotBlockMode.FillSlot,
|
||||
1,
|
||||
OverflowPolicy.ContinueNext
|
||||
new SlotContent(
|
||||
"Конец вещания",
|
||||
SlotKind.SignOff,
|
||||
Guid.NewGuid(),
|
||||
"{\"type\":\"sequential\"}",
|
||||
null,
|
||||
SlotBlockMode.FillSlot,
|
||||
1,
|
||||
OverflowPolicy.ContinueNext
|
||||
)
|
||||
);
|
||||
|
||||
// Иначе генератор прочитал бы настройки, оставшиеся от прежнего типа слота.
|
||||
|
||||
Reference in New Issue
Block a user