* fix plex library synchronization * add basic plex movie synchronization * proxy plex movie thumbnails (posters) * add plex path replacements * use transcoded plex artwork * remove unsynchronized plex movies on save; queue plex library scan on save * log plex path replacements * prefer buttons instead of menus * lock plex libraries before sync * add movie to collection from paged view * fix plex import memory use; quick add seasons/shows * quick add episode to collection * add favicon * add search page * disable plex for now
22 lines
871 B
C#
22 lines
871 B
C#
using System.Linq;
|
|
using ErsatzTV.Core.Domain;
|
|
using static LanguageExt.Prelude;
|
|
|
|
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);
|
|
}
|
|
}
|