* properly scope jellyfin disconnect * add emby entities * add emby media source page * add emby media source editor * sync emby libraries * enable emby library sync toggle * add emby path replacements editor * add emby movie synchronization * fix emby artwork * sync emby television * code cleanup * add jellyfin/emby address placeholder * tweak jellyfin/emby address form
20 lines
792 B
C#
20 lines
792 B
C#
using ErsatzTV.Core.Domain;
|
|
|
|
namespace ErsatzTV.Application.Emby
|
|
{
|
|
internal static class Mapper
|
|
{
|
|
internal static EmbyMediaSourceViewModel ProjectToViewModel(EmbyMediaSource embyMediaSource) =>
|
|
new(
|
|
embyMediaSource.Id,
|
|
embyMediaSource.ServerName,
|
|
embyMediaSource.Connections.HeadOrNone().Match(c => c.Address, string.Empty));
|
|
|
|
internal static EmbyLibraryViewModel ProjectToViewModel(EmbyLibrary library) =>
|
|
new(library.Id, library.Name, library.MediaKind, library.ShouldSyncItems);
|
|
|
|
internal static EmbyPathReplacementViewModel ProjectToViewModel(EmbyPathReplacement pathReplacement) =>
|
|
new(pathReplacement.Id, pathReplacement.EmbyPath, pathReplacement.LocalPath);
|
|
}
|
|
}
|