Files
ersatztv/ErsatzTV.Application/Plex/Mapper.cs
T
Jason DoveandGitHub c02b83d0d6 code cleanup (#743)
* update tools

* run code cleanup

* update dependencies
2022-04-19 17:47:18 -05:00

19 lines
768 B
C#

using ErsatzTV.Core.Domain;
namespace ErsatzTV.Application.Plex;
internal static class Mapper
{
internal static PlexMediaSourceViewModel ProjectToViewModel(PlexMediaSource plexMediaSource) =>
new(
plexMediaSource.Id,
plexMediaSource.ServerName,
Optional(plexMediaSource.Connections.SingleOrDefault(c => c.IsActive)).Match(c => c.Uri, string.Empty));
internal static PlexLibraryViewModel ProjectToViewModel(PlexLibrary library) =>
new(library.Id, library.Name, library.MediaKind, library.ShouldSyncItems);
internal static PlexPathReplacementViewModel ProjectToViewModel(PlexPathReplacement pathReplacement) =>
new(pathReplacement.Id, pathReplacement.PlexPath, pathReplacement.LocalPath);
}