show collection name in some error messages (#612)

This commit is contained in:
Jason Dove
2022-02-04 20:17:17 -06:00
committed by GitHub
parent 5fd315ead8
commit 0c53a4509c
5 changed files with 51 additions and 3 deletions
+17 -3
View File
@@ -73,9 +73,23 @@ namespace ErsatzTV.Core.Scheduling
Option<CollectionKey> maybeEmptyCollection = await CheckForEmptyCollections(collectionMediaItems);
foreach (CollectionKey emptyCollection in maybeEmptyCollection)
{
_logger.LogError(
"Unable to rebuild playout; collection {@CollectionKey} has no valid items!",
emptyCollection);
Option<string> maybeName = await _mediaCollectionRepository.GetNameFromKey(emptyCollection);
if (maybeName.IsSome)
{
foreach (string name in maybeName)
{
_logger.LogError(
"Unable to rebuild playout; {CollectionType} {CollectionName} has no valid items!",
emptyCollection.CollectionType,
name);
}
}
else
{
_logger.LogError(
"Unable to rebuild playout; collection {@CollectionKey} has no valid items!",
emptyCollection);
}
return playout;
}