upgrade from dotnet 7 to dotnet 8 (#1529)

* upgrade sdk

* fix warnings in ersatztv.ffmpeg

* fix warnings in ersatztv.core

* fix warnings in ersatztv.infrastructure

* fix warnings in ersatztv.application

* disable analysis for migrations projects

* fix warnings in ersatztv.scanner

* fix warnings in ersatztv

* upgrade project framework

* update github actions and dockerfiles
This commit is contained in:
Jason Dove
2023-12-30 13:29:57 -06:00
committed by GitHub
parent 3a84af1626
commit 9471cb55dd
158 changed files with 429 additions and 435 deletions
@@ -6,7 +6,7 @@ public static class MultiCollectionGrouper
{
var result = new List<GroupedMediaItem>();
foreach (CollectionWithItems collection in collections.Where(collection => collection.MediaItems.Any()))
foreach (CollectionWithItems collection in collections.Where(collection => collection.MediaItems.Count != 0))
{
if (collection.ScheduleAsGroup)
{
+3 -3
View File
@@ -251,7 +251,7 @@ public class PlayoutBuilder : IPlayoutBuilder
private async Task<Option<PlayoutParameters>> Validate(Playout playout)
{
Map<CollectionKey, List<MediaItem>> collectionMediaItems = await GetCollectionMediaItems(playout);
if (!collectionMediaItems.Any())
if (collectionMediaItems.IsEmpty)
{
_logger.LogWarning("Playout {Playout} has no items", playout.Channel.Name);
return None;
@@ -543,7 +543,7 @@ public class PlayoutBuilder : IPlayoutBuilder
// once more to get playout anchor
ProgramScheduleItem anchorScheduleItem = playoutBuilderState.ScheduleItemsEnumerator.Current;
if (playout.Items.Any())
if (playout.Items.Count != 0)
{
DateTimeOffset maxStartTime = playout.Items.Max(i => i.FinishOffset);
if (maxStartTime < playoutBuilderState.CurrentTime)
@@ -655,7 +655,7 @@ public class PlayoutBuilder : IPlayoutBuilder
items.RemoveAll(zeroItems.Contains);
}
return collectionMediaItems.Find(c => !c.Value.Any()).Map(c => c.Key);
return collectionMediaItems.Find(c => c.Value.Count == 0).Map(c => c.Key);
}
private static PlayoutAnchor FindStartAnchor(
@@ -130,7 +130,7 @@ public class PlayoutModeSchedulerFlood : PlayoutModeSchedulerBase<ProgramSchedul
nextState = nextState with
{
InFlood = playoutItems.Any() && nextState.CurrentTime >= hardStop,
InFlood = playoutItems.Count != 0 && nextState.CurrentTime >= hardStop,
// only decrement guide group if it was bumped
NextGuideGroup = playoutItems.Select(pi => pi.GuideGroup).Distinct().Count() != 1
@@ -86,7 +86,7 @@ public class ShuffleInOrderCollectionEnumerator : IMediaCollectionEnumerator
public int Count => _shuffled.Count;
private IList<MediaItem> Shuffle(IList<CollectionWithItems> collections, Random random)
private MediaItem[] Shuffle(IList<CollectionWithItems> collections, Random random)
{
// based on https://keyj.emphy.de/balanced-shuffle/
@@ -126,7 +126,7 @@ public class ShuffleInOrderCollectionEnumerator : IMediaCollectionEnumerator
}
}
return result;
return result.ToArray();
}
private List<OrderedCollection> Fill(List<OrderedCollection> orderedCollections, Random random)
@@ -166,12 +166,12 @@ public class ShuffleInOrderCollectionEnumerator : IMediaCollectionEnumerator
k--;
}
if (smaller.Any())
if (smaller.Count != 0)
{
ordered.AddRange(smaller);
}
if (larger.Any())
if (larger.Count != 0)
{
ordered.AddRange(larger);
}
@@ -188,20 +188,20 @@ public class ShuffleInOrderCollectionEnumerator : IMediaCollectionEnumerator
return result;
}
private static IList<Option<MediaItem>> OrderItems(CollectionWithItems collectionWithItems)
private static Option<MediaItem>[] OrderItems(CollectionWithItems collectionWithItems)
{
if (collectionWithItems.UseCustomOrder)
{
return collectionWithItems.MediaItems.Map(Some).ToList();
return collectionWithItems.MediaItems.Map(Some).ToArray();
}
return collectionWithItems.MediaItems
.OrderBy(identity, new ChronologicalMediaComparer())
.Map(Some)
.ToList();
.ToArray();
}
private static IList<Option<MediaItem>> Shuffle(IEnumerable<Option<MediaItem>> list, Random random)
private static Option<MediaItem>[] Shuffle(IEnumerable<Option<MediaItem>> list, Random random)
{
Option<MediaItem>[] copy = list.ToArray();
@@ -87,7 +87,7 @@ public class ShuffledScheduleItemsEnumerator : IScheduleItemsEnumerator
return _shuffled[(State.Index + offset) % _scheduleItemsCount];
}
private static IList<ProgramScheduleItem> Shuffle(IEnumerable<ProgramScheduleItem> list, CloneableRandom random)
private static ProgramScheduleItem[] Shuffle(IEnumerable<ProgramScheduleItem> list, CloneableRandom random)
{
ProgramScheduleItem[] copy = list.ToArray();