refactor dbcontext lifetime (#258)

* refactor create playout handler

* refactor get all playouts handler

* refactor delete playout handler

* remove dead code

* ignore unnamed artists for collections

* more repository cleanup

* more schedule items refactoring

* more playout refactoring

* refactor playout builder

* refactor ffmpeg profiles

* more ffmpeg profile refactoring

* rework resolutions

* refactor media collections

* refactor config elements

* update changelog

* more cleanup
This commit is contained in:
Jason Dove
2021-06-13 20:19:10 -05:00
committed by GitHub
parent 4172074ac4
commit 0fb5bfde58
208 changed files with 1532 additions and 16934 deletions
@@ -0,0 +1,18 @@
using System;
using System.Linq;
using System.Threading.Tasks;
using ErsatzTV.Core.Domain;
using LanguageExt;
namespace ErsatzTV.Infrastructure.Extensions
{
public static class ConfigElementQueryableExtensions
{
public static Task<Option<T>> GetValue<T>(
this IQueryable<ConfigElement> configElements,
ConfigElementKey key) =>
configElements
.SelectOneAsync(ce => ce.Key, ce => ce.Key == key.Key)
.MapT(ce => (T) Convert.ChangeType(ce.Value, typeof(T)));
}
}