add basic image library support (#1608)
* add basic image library support * add image page * update changelog
This commit is contained in:
@@ -75,6 +75,10 @@ public class BlockPlayoutBuilder(
|
||||
}
|
||||
|
||||
DateTimeOffset currentTime = start;
|
||||
if (updatedEffectiveBlocks.Count > 0)
|
||||
{
|
||||
currentTime = updatedEffectiveBlocks.Min(eb => eb.Start);
|
||||
}
|
||||
|
||||
foreach (EffectiveBlock effectiveBlock in updatedEffectiveBlocks)
|
||||
{
|
||||
@@ -128,6 +132,8 @@ public class BlockPlayoutBuilder(
|
||||
historyKey,
|
||||
collectionMediaItems);
|
||||
|
||||
bool pastTime = false;
|
||||
|
||||
foreach (MediaItem mediaItem in enumerator.Current)
|
||||
{
|
||||
Logger.LogDebug(
|
||||
@@ -171,6 +177,7 @@ public class BlockPlayoutBuilder(
|
||||
effectiveBlock.Block.Name,
|
||||
blockFinish);
|
||||
|
||||
pastTime = true;
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -194,6 +201,11 @@ public class BlockPlayoutBuilder(
|
||||
currentTime += itemDuration;
|
||||
enumerator.MoveNext();
|
||||
}
|
||||
|
||||
if (pastTime)
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -337,6 +349,11 @@ public class BlockPlayoutBuilder(
|
||||
|
||||
private static TimeSpan DurationForMediaItem(MediaItem mediaItem)
|
||||
{
|
||||
if (mediaItem is Image)
|
||||
{
|
||||
return TimeSpan.FromSeconds(Domain.Image.DefaultSeconds);
|
||||
}
|
||||
|
||||
MediaVersion version = mediaItem.GetHeadVersion();
|
||||
return version.Duration;
|
||||
}
|
||||
|
||||
@@ -300,8 +300,8 @@ public class PlayoutBuilder : IPlayoutBuilder
|
||||
return None;
|
||||
}
|
||||
|
||||
playout.Items ??= new List<PlayoutItem>();
|
||||
playout.ProgramScheduleAnchors ??= new List<PlayoutProgramScheduleAnchor>();
|
||||
playout.Items ??= [];
|
||||
playout.ProgramScheduleAnchors ??= [];
|
||||
|
||||
Option<int> daysToBuild = await _configElementRepository.GetValue<int>(ConfigElementKey.PlayoutDaysToBuild);
|
||||
|
||||
@@ -791,6 +791,7 @@ public class PlayoutBuilder : IPlayoutBuilder
|
||||
.IfNoneAsync(TimeSpan.Zero) == TimeSpan.Zero,
|
||||
Song s => await s.MediaVersions.Map(v => v.Duration).HeadOrNone()
|
||||
.IfNoneAsync(TimeSpan.Zero) == TimeSpan.Zero,
|
||||
Image => false,
|
||||
_ => true
|
||||
};
|
||||
|
||||
@@ -1097,6 +1098,10 @@ public class PlayoutBuilder : IPlayoutBuilder
|
||||
return s.SongMetadata.HeadOrNone().Match(
|
||||
sm => sm.Title ?? string.Empty,
|
||||
() => "[unknown song]");
|
||||
case Image i:
|
||||
return i.ImageMetadata.HeadOrNone().Match(
|
||||
sm => sm.Title ?? string.Empty,
|
||||
() => "[unknown song]");
|
||||
default:
|
||||
return string.Empty;
|
||||
}
|
||||
|
||||
@@ -179,6 +179,11 @@ public abstract class PlayoutModeSchedulerBase<T> : IPlayoutModeScheduler<T> whe
|
||||
|
||||
protected static TimeSpan DurationForMediaItem(MediaItem mediaItem)
|
||||
{
|
||||
if (mediaItem is Image)
|
||||
{
|
||||
return TimeSpan.FromSeconds(Domain.Image.DefaultSeconds);
|
||||
}
|
||||
|
||||
MediaVersion version = mediaItem.GetHeadVersion();
|
||||
return version.Duration;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user