diff --git a/EmbyStat.Clients.Base/Http/BaseHttpClient.cs b/EmbyStat.Clients.Base/Http/BaseHttpClient.cs
index ee9c9f4c7..38bd6d4e1 100644
--- a/EmbyStat.Clients.Base/Http/BaseHttpClient.cs
+++ b/EmbyStat.Clients.Base/Http/BaseHttpClient.cs
@@ -1,6 +1,5 @@
using System;
using System.Collections.Generic;
-using System.Linq;
using System.Net;
using System.Net.NetworkInformation;
using System.Net.Sockets;
diff --git a/EmbyStat.Clients.Tmdb/TmdbClient.cs b/EmbyStat.Clients.Tmdb/TmdbClient.cs
index 8204e191a..4ccda2c1d 100644
--- a/EmbyStat.Clients.Tmdb/TmdbClient.cs
+++ b/EmbyStat.Clients.Tmdb/TmdbClient.cs
@@ -3,7 +3,6 @@
using System.Linq;
using System.Threading.Tasks;
using AutoMapper;
-using EmbyStat.Clients.Base.Metadata;
using EmbyStat.Common.Models.Show;
using EmbyStat.Configuration;
using EmbyStat.Configuration.Interfaces;
diff --git a/EmbyStat.Clients.TvMaze/EmbyStat.Clients.TvMaze.csproj b/EmbyStat.Clients.TvMaze/EmbyStat.Clients.TvMaze.csproj
index 7ec11cfdc..ecf7148de 100644
--- a/EmbyStat.Clients.TvMaze/EmbyStat.Clients.TvMaze.csproj
+++ b/EmbyStat.Clients.TvMaze/EmbyStat.Clients.TvMaze.csproj
@@ -7,7 +7,7 @@
-
+
diff --git a/EmbyStat.Clients.TvMaze/TvMazeShowClient.cs b/EmbyStat.Clients.TvMaze/TvMazeShowClient.cs
index 932a17d87..b8f0ff655 100644
--- a/EmbyStat.Clients.TvMaze/TvMazeShowClient.cs
+++ b/EmbyStat.Clients.TvMaze/TvMazeShowClient.cs
@@ -1,8 +1,5 @@
using AutoMapper;
-using EmbyStat.Clients.Base.Metadata;
-using EmbyStat.Clients.Tmdb;
using EmbyStat.Common.Models.Show;
-using EmbyStat.Configuration;
using EmbyStat.Configuration.Interfaces;
using TvMaze.Api.Client;
using TvMaze.Api.Client.Models;
diff --git a/EmbyStat.Common/Constants.cs b/EmbyStat.Common/Constants.cs
index 6776207e7..41b695b35 100644
--- a/EmbyStat.Common/Constants.cs
+++ b/EmbyStat.Common/Constants.cs
@@ -123,4 +123,10 @@ public static class JwtClaimIdentifiers
//COMMON
public static string Unknown => "UNKNOWN";
+
+ public static class Users
+ {
+ public static string TotalWatchedEpisodes => "USERS.WATCHED.EPISODES";
+ public static string TotalWatchedMovies => "USERS.WATCHED.MOVIES";
+ }
}
\ No newline at end of file
diff --git a/EmbyStat.Common/Converters/SessionConverter.cs b/EmbyStat.Common/Converters/SessionConverter.cs
index c4092b028..4eb9f3487 100644
--- a/EmbyStat.Common/Converters/SessionConverter.cs
+++ b/EmbyStat.Common/Converters/SessionConverter.cs
@@ -27,7 +27,7 @@ public static IEnumerable ConvertToSessions(JArray sessions)
if (session["PlayState"]["MediaSourceId"] != null)
{
- Enum.TryParse(session["NowPlayingItem"]["Type"].Value(), true, out PlayType playType);
+ Enum.TryParse(session["NowPlayingItem"]["Type"].Value(), true, out MediaType playType);
var play = new Play
{
MediaId = session["NowPlayingItem"]["Id"].Value(),
diff --git a/EmbyStat.Common/EmbyStat.Common.csproj b/EmbyStat.Common/EmbyStat.Common.csproj
index 393c6f844..a8ca4a33e 100644
--- a/EmbyStat.Common/EmbyStat.Common.csproj
+++ b/EmbyStat.Common/EmbyStat.Common.csproj
@@ -22,15 +22,15 @@
-
-
-
+
+
+
-
+
diff --git a/EmbyStat.Common/Enums/PlayType.cs b/EmbyStat.Common/Enums/MediaType.cs
similarity index 84%
rename from EmbyStat.Common/Enums/PlayType.cs
rename to EmbyStat.Common/Enums/MediaType.cs
index 6a98add37..6435334ef 100644
--- a/EmbyStat.Common/Enums/PlayType.cs
+++ b/EmbyStat.Common/Enums/MediaType.cs
@@ -1,6 +1,6 @@
namespace EmbyStat.Common.Enums;
-public enum PlayType
+public enum MediaType
{
Unknown = 0,
Movie = 1,
diff --git a/EmbyStat.Common/Extensions/LibrarySyncTypeExtensions.cs b/EmbyStat.Common/Extensions/LibrarySyncTypeExtensions.cs
new file mode 100644
index 000000000..c97b1f96a
--- /dev/null
+++ b/EmbyStat.Common/Extensions/LibrarySyncTypeExtensions.cs
@@ -0,0 +1,16 @@
+using System;
+using System.Collections;
+using System.Collections.Generic;
+using System.Linq;
+using EmbyStat.Common.Enums;
+using EmbyStat.Common.Models.Entities;
+
+namespace EmbyStat.Common.Extensions;
+
+public static class LibrarySyncTypeExtensions
+{
+ public static DateTime? GetLastSyncedDateForLibrary(this IEnumerable items, string libraryId, LibraryType type)
+ {
+ return items.FirstOrDefault(x => x.LibraryId == libraryId && x.SyncType == type)?.LastSynced;
+ }
+}
\ No newline at end of file
diff --git a/EmbyStat.Common/Models/Cards/Card.cs b/EmbyStat.Common/Models/Cards/Card.cs
index 66fa56c99..3e44a1589 100644
--- a/EmbyStat.Common/Models/Cards/Card.cs
+++ b/EmbyStat.Common/Models/Cards/Card.cs
@@ -2,10 +2,10 @@
namespace EmbyStat.Common.Models.Cards;
-public class Card
+public class Card
{
public string Title { get; set; }
- public T Value { get; set; }
+ public string Value { get; set; }
public CardType Type { get; set; }
public string Icon { get; set; }
}
\ No newline at end of file
diff --git a/EmbyStat.Common/Models/Entities/Events/Play.cs b/EmbyStat.Common/Models/Entities/Events/Play.cs
index 050a7d971..3cfee28e1 100644
--- a/EmbyStat.Common/Models/Entities/Events/Play.cs
+++ b/EmbyStat.Common/Models/Entities/Events/Play.cs
@@ -9,7 +9,7 @@ public class Play
public Guid Id { get; set; }
public string SessionId { get; set; }
public string UserId { get; set; }
- public PlayType Type { get; set; }
+ public MediaType Type { get; set; }
public string MediaId { get; set; }
public ICollection PlayStates { get; set; }
public string SubtitleCodec { get; set; }
diff --git a/EmbyStat.Common/Models/Entities/Helpers/ILinkedMedia.cs b/EmbyStat.Common/Models/Entities/Helpers/ILinkedMedia.cs
index 2f92f77cf..9f0bf1c6d 100644
--- a/EmbyStat.Common/Models/Entities/Helpers/ILinkedMedia.cs
+++ b/EmbyStat.Common/Models/Entities/Helpers/ILinkedMedia.cs
@@ -7,4 +7,5 @@ public interface ILinkedMedia
ICollection People { get; set; }
ICollection Genres { get; set; }
Library Library { get; set; }
+ public string LibraryId { get; set; }
}
\ No newline at end of file
diff --git a/EmbyStat.Common/Models/Entities/Library.cs b/EmbyStat.Common/Models/Entities/Library.cs
index 41ff06f12..5fec1252f 100644
--- a/EmbyStat.Common/Models/Entities/Library.cs
+++ b/EmbyStat.Common/Models/Entities/Library.cs
@@ -11,8 +11,7 @@ public class Library
public string Name { get; set; }
public string Primary { get; set; }
public LibraryType Type { get; set; }
- public bool Sync { get; set; }
- public DateTime? LastSynced { get; set; }
public ICollection Movies { get; set; }
public ICollection Shows { get; set; }
+ public ICollection SyncTypes { get; set; }
}
\ No newline at end of file
diff --git a/EmbyStat.Common/Models/Entities/LibrarySyncType.cs b/EmbyStat.Common/Models/Entities/LibrarySyncType.cs
new file mode 100644
index 000000000..d067fe4ce
--- /dev/null
+++ b/EmbyStat.Common/Models/Entities/LibrarySyncType.cs
@@ -0,0 +1,13 @@
+ using System;
+ using EmbyStat.Common.Enums;
+
+ namespace EmbyStat.Common.Models.Entities;
+
+public class LibrarySyncType
+{
+ public string Id { get; set; }
+ public string LibraryId { get; set; }
+ public Library Library { get; set; }
+ public LibraryType SyncType { get; set; }
+ public DateTime? LastSynced { get; set; }
+}
\ No newline at end of file
diff --git a/EmbyStat.Common/Models/Entities/MediaServerUserView.cs b/EmbyStat.Common/Models/Entities/MediaServerUserView.cs
index ed27d871c..1e22b43d0 100644
--- a/EmbyStat.Common/Models/Entities/MediaServerUserView.cs
+++ b/EmbyStat.Common/Models/Entities/MediaServerUserView.cs
@@ -1,4 +1,5 @@
using System;
+using EmbyStat.Common.Enums;
using EmbyStat.Common.Models.Entities.Users;
namespace EmbyStat.Common.Models.Entities;
@@ -7,7 +8,7 @@ public class MediaServerUserView
{
public string UserId { get; set; }
public MediaServerUser User { get; set; }
- public string MediaType { get; set; }
+ public MediaType MediaType { get; set; }
public string MediaId { get; set; }
public int PlayCount { get; set; }
public DateTime LastPlayedDate { get; set; }
diff --git a/EmbyStat.Common/Models/Entities/Movies/Movie.cs b/EmbyStat.Common/Models/Entities/Movies/Movie.cs
index 891ec4f62..cd4244620 100644
--- a/EmbyStat.Common/Models/Entities/Movies/Movie.cs
+++ b/EmbyStat.Common/Models/Entities/Movies/Movie.cs
@@ -27,5 +27,6 @@ public override int GetHashCode()
public ICollection People { get; set; }
public ICollection Genres { get; set; }
public Library Library { get; set; }
+ public string LibraryId { get; set; }
#endregion
}
\ No newline at end of file
diff --git a/EmbyStat.Common/Models/Entities/Users/MediaServerUser.cs b/EmbyStat.Common/Models/Entities/Users/MediaServerUser.cs
index a7bdadb0c..fef43ca07 100644
--- a/EmbyStat.Common/Models/Entities/Users/MediaServerUser.cs
+++ b/EmbyStat.Common/Models/Entities/Users/MediaServerUser.cs
@@ -14,12 +14,10 @@ public class MediaServerUser
public string PrimaryImageTag { get; set; }
public DateTimeOffset? LastLoginDate { get; set; }
public DateTimeOffset? LastActivityDate { get; set; }
-
public bool PlayDefaultAudioTrack { get; set; }
public string SubtitleLanguagePreference { get; set; }
public bool DisplayMissingEpisodes { get; set; }
public string SubtitleMode { get; set; }
-
public bool IsAdministrator { get; set; }
public bool IsHidden { get; set; }
public bool IsHiddenRemotely { get; set; }
diff --git a/EmbyStat.Controllers/EmbyStat.Controllers.csproj b/EmbyStat.Controllers/EmbyStat.Controllers.csproj
index 7ea0e935a..88d8f7d61 100644
--- a/EmbyStat.Controllers/EmbyStat.Controllers.csproj
+++ b/EmbyStat.Controllers/EmbyStat.Controllers.csproj
@@ -11,11 +11,11 @@
-
+
-
+
diff --git a/EmbyStat.Controllers/HelperClasses/CardViewModel.cs b/EmbyStat.Controllers/HelperClasses/CardViewModel.cs
index 4e57331d6..e6933b1a8 100644
--- a/EmbyStat.Controllers/HelperClasses/CardViewModel.cs
+++ b/EmbyStat.Controllers/HelperClasses/CardViewModel.cs
@@ -1,9 +1,9 @@
namespace EmbyStat.Controllers.HelperClasses;
-public class CardViewModel
+public class CardViewModel
{
public string Title { get; set; }
- public T Value { get; set; }
+ public string Value { get; set; }
public string Type { get; set; }
public string Icon { get; set; }
}
\ No newline at end of file
diff --git a/EmbyStat.Controllers/MapProfiles.cs b/EmbyStat.Controllers/MapProfiles.cs
index e1c20697b..dfb3c6470 100644
--- a/EmbyStat.Controllers/MapProfiles.cs
+++ b/EmbyStat.Controllers/MapProfiles.cs
@@ -67,10 +67,10 @@ public MapProfiles()
src => src.MapFrom((org, _) =>
org.EndTimeUtc?.ToString("O") ?? string.Empty));
- CreateMap(typeof(Card<>), typeof(CardViewModel<>))
+ CreateMap()
.ForMember("Type", src => src.MapFrom((org, _) =>
{
- return ((Card) org).Type switch
+ return ((Card) org).Type switch
{
CardType.Text => "text",
CardType.Size => "size",
@@ -79,7 +79,8 @@ public MapProfiles()
};
}));
- CreateMap();
+ CreateMap()
+ .ForMember(x => x.Sync, x => x.Ignore());
CreateMap();
CreateMap()
@@ -145,13 +146,16 @@ private void CreateMediaServerUserMappings()
.ForMember(x => x.DisplayMissingEpisodes, x => x.MapFrom(y => y.Configuration.DisplayMissingEpisodes))
.ForMember(x => x.SubtitleMode, x => x.MapFrom(y => y.Configuration.SubtitleMode));
+ CreateMap();
CreateMap();
CreateMap();
+ CreateMap();
+
CreateMap();
CreateMap()
.ForMember(x => x.MediaId, x => x.MapFrom(y => y.Id))
- .ForMember(x => x.MediaType, x => x.MapFrom(y => y.Type))
+ .ForMember(x => x.MediaType, x => x.MapFrom(y => MapMediaType(y.Type)))
.ForMember(x => x.PlayCount, x => x.MapFrom(y => y.UserData.PlayCount))
.ForMember(x => x.UserId, x => x.Ignore())
.ForMember(x => x.LastPlayedDate, x => x.MapFrom(y => y.UserData.LastPlayedDate));
@@ -324,6 +328,16 @@ private void CreateLibraryMappings()
.ForMember(x => x.Type, x => x.MapFrom(y => y.CollectionType.ToLibraryType()))
.ForMember(x => x.Primary, x => x.MapFrom(y => y.ImageTags.ConvertToImageTag()));
}
+
+ private static MediaType MapMediaType(string type)
+ {
+ return type switch
+ {
+ "Movie" => MediaType.Movie,
+ "Episode" => MediaType.Episode,
+ _ => MediaType.Unknown
+ };
+ }
}
public static class DictionaryMappingExtensions
diff --git a/EmbyStat.Controllers/MediaServer/MediaServerController.cs b/EmbyStat.Controllers/MediaServer/MediaServerController.cs
index 33f431f29..69a3a8a26 100644
--- a/EmbyStat.Controllers/MediaServer/MediaServerController.cs
+++ b/EmbyStat.Controllers/MediaServer/MediaServerController.cs
@@ -82,7 +82,8 @@ public async Task GetMediaServerStatus()
public async Task GetMediaServerLibraries()
{
var result = await _mediaServerService.GetMediaServerLibraries();
- return Ok(_mapper.Map>(result));
+ var map = _mapper.Map>(result);
+ return Ok(map);
}
[HttpPost]
@@ -144,13 +145,11 @@ public async Task GetUserById(string id)
var mappedUser = _mapper.Map(user);
- var viewedEpisodeCount = _mediaServerService.GetViewedEpisodeCountByUserId(id);
- var viewedMovieCount = _mediaServerService.GetViewedMovieCountByUserId(id);
- var lastWatchedMedia = _mediaServerService.GetUserViewPageByUserId(id, 0,10).ToList();
+ var viewedEpisodeCount = await _mediaServerService.GetViewedEpisodeCountByUserId(id);
+ var viewedMovieCount = await _mediaServerService.GetViewedMovieCountByUserId(id);
- mappedUser.ViewedEpisodeCount = _mapper.Map>(viewedEpisodeCount);
- mappedUser.ViewedMovieCount = _mapper.Map>(viewedMovieCount);
- mappedUser.LastWatchedMedia = _mapper.Map>(lastWatchedMedia);
+ mappedUser.ViewedEpisodeCount = _mapper.Map(viewedEpisodeCount);
+ mappedUser.ViewedMovieCount = _mapper.Map(viewedMovieCount);
return Ok(mappedUser);
}
diff --git a/EmbyStat.Controllers/MediaServer/MediaServerUserStatisticsViewModel.cs b/EmbyStat.Controllers/MediaServer/MediaServerUserStatisticsViewModel.cs
index 99ca6d561..661ed3121 100644
--- a/EmbyStat.Controllers/MediaServer/MediaServerUserStatisticsViewModel.cs
+++ b/EmbyStat.Controllers/MediaServer/MediaServerUserStatisticsViewModel.cs
@@ -5,6 +5,5 @@ namespace EmbyStat.Controllers.MediaServer;
public class MediaServerUserStatisticsViewModel
{
- public List> Cards { get; set; }
-
+ public List Cards { get; set; }
}
\ No newline at end of file
diff --git a/EmbyStat.Controllers/MediaServer/UserFullViewModel.cs b/EmbyStat.Controllers/MediaServer/UserFullViewModel.cs
index a57f2458a..c87dfedce 100644
--- a/EmbyStat.Controllers/MediaServer/UserFullViewModel.cs
+++ b/EmbyStat.Controllers/MediaServer/UserFullViewModel.cs
@@ -1,4 +1,4 @@
-using System.Collections.Generic;
+using System;
using EmbyStat.Controllers.HelperClasses;
namespace EmbyStat.Controllers.MediaServer;
@@ -7,10 +7,28 @@ public class UserFullViewModel
{
public string Id { get; set; }
public string Name { get; set; }
+ public string PrimaryImageTag { get; set; }
+ public DateTimeOffset? LastLoginDate { get; set; }
+ public DateTimeOffset? LastActivityDate { get; set; }
+ public string SubtitleLanguagePreference { get; set; }
public string ServerId { get; set; }
public bool IsAdministrator { get; set; }
- public bool Deleted { get; set; }
- public CardViewModel ViewedMovieCount { get; set; }
- public CardViewModel ViewedEpisodeCount { get; set; }
- public IList LastWatchedMedia { get; set; }
+ public bool IsHidden { get; set; }
+ public bool IsHiddenRemotely { get; set; }
+ public bool IsHiddenFromUnusedDevices { get; set; }
+ public bool IsDisabled { get; set; }
+ public bool EnableLiveTvAccess { get; set; }
+ public bool EnableContentDeletion { get; set; }
+ public bool EnableContentDownloading { get; set; }
+ public bool EnableSubtitleDownloading { get; set; }
+ public bool EnableSubtitleManagement { get; set; }
+ public bool EnableSyncTranscoding { get; set; }
+ public bool EnableMediaConversion { get; set; }
+ public int InvalidLoginAttemptCount { get; set; }
+ public bool EnablePublicSharing { get; set; }
+ public int RemoteClientBitrateLimit { get; set; }
+ public int SimultaneousStreamLimit { get; set; }
+ public bool EnableAllDevices { get; set; }
+ public CardViewModel ViewedMovieCount { get; set; }
+ public CardViewModel ViewedEpisodeCount { get; set; }
}
\ No newline at end of file
diff --git a/EmbyStat.Controllers/Movie/MovieController.cs b/EmbyStat.Controllers/Movie/MovieController.cs
index 760fa3d58..805630db1 100644
--- a/EmbyStat.Controllers/Movie/MovieController.cs
+++ b/EmbyStat.Controllers/Movie/MovieController.cs
@@ -1,11 +1,14 @@
using System;
using System.Collections.Generic;
+using System.Linq;
using System.Threading.Tasks;
using AutoMapper;
+using EmbyStat.Common.Enums;
using EmbyStat.Common.Models.Query;
using EmbyStat.Controllers.HelperClasses;
using EmbyStat.Core.Movies.Interfaces;
using Microsoft.AspNetCore.Mvc;
+using MoreLinq;
using Newtonsoft.Json;
namespace EmbyStat.Controllers.Movie;
@@ -53,12 +56,13 @@ public async Task GetMoviePageList(int skip, int take, string sor
public async Task GetMovie(string id)
{
var result = await _movieService.GetMovie(id);
- if (result != null)
+ if (result == null)
{
- var movie = _mapper.Map(result);
- return Ok(movie);
+ return NotFound(id);
}
- return NotFound(id);
+
+ var movie = _mapper.Map(result);
+ return Ok(movie);
}
[HttpGet]
@@ -66,7 +70,15 @@ public async Task GetMovie(string id)
public async Task GetLibraries()
{
var result = await _movieService.GetMovieLibraries();
- return Ok(_mapper.Map>(result));
+ var map = _mapper.Map>(result, opts =>
+ opts.AfterMap((src, dest) =>
+ {
+ dest.ForEach(x => x.Sync = result
+ .Single(y => y.Id == x.Id).SyncTypes
+ .Any(y => y.SyncType == LibraryType.Movies));
+ }));
+
+ return Ok(map);
}
[HttpPost]
diff --git a/EmbyStat.Controllers/Movie/MovieStatisticsViewModel.cs b/EmbyStat.Controllers/Movie/MovieStatisticsViewModel.cs
index 9a31e5d47..40d4e14eb 100644
--- a/EmbyStat.Controllers/Movie/MovieStatisticsViewModel.cs
+++ b/EmbyStat.Controllers/Movie/MovieStatisticsViewModel.cs
@@ -6,7 +6,7 @@ namespace EmbyStat.Controllers.Movie;
public class MovieStatisticsViewModel
{
- public List> Cards { get; set; }
+ public List Cards { get; set; }
public List TopCards { get; set; }
public List Charts { get; set; }
public List Shorts { get; set; }
diff --git a/EmbyStat.Controllers/Show/ShowController.cs b/EmbyStat.Controllers/Show/ShowController.cs
index 4ac1e461e..8d38c756d 100644
--- a/EmbyStat.Controllers/Show/ShowController.cs
+++ b/EmbyStat.Controllers/Show/ShowController.cs
@@ -1,11 +1,14 @@
using System;
using System.Collections.Generic;
+using System.Linq;
using System.Threading.Tasks;
using AutoMapper;
+using EmbyStat.Common.Enums;
using EmbyStat.Common.Models.Query;
using EmbyStat.Controllers.HelperClasses;
using EmbyStat.Core.Shows.Interfaces;
using Microsoft.AspNetCore.Mvc;
+using MoreLinq.Extensions;
using Newtonsoft.Json;
namespace EmbyStat.Controllers.Show;
@@ -28,10 +31,17 @@ public ShowController(IShowService showService, IMapper mapper)
public async Task GetLibraries()
{
var result = await _showService.GetShowLibraries();
- var convert = _mapper.Map>(result);
- return Ok(convert);
+ var map = _mapper.Map>(result, opts =>
+ opts.AfterMap((src, dest) =>
+ {
+ dest.ForEach(x => x.Sync = result
+ .Single(y => y.Id == x.Id).SyncTypes
+ .Any(y => y.SyncType == LibraryType.TvShow));
+ }));
+
+ return Ok(map);
}
-
+
[HttpPost]
[Route("libraries")]
public async Task UpdateLibraries([FromBody] string[] libraryIds)
@@ -51,7 +61,8 @@ public async Task GetStatistics()
[HttpGet]
[Route("list")]
- public async Task GetShowPageList(int skip, int take, string sortField, string sortOrder, bool requireTotalCount, string filter)
+ public async Task GetShowPageList(int skip, int take, string sortField, string sortOrder,
+ bool requireTotalCount, string filter)
{
var filtersObj = Array.Empty();
if (filter != null)
diff --git a/EmbyStat.Controllers/Show/ShowStatisticsViewModel.cs b/EmbyStat.Controllers/Show/ShowStatisticsViewModel.cs
index cf337143a..c9bfa60d1 100644
--- a/EmbyStat.Controllers/Show/ShowStatisticsViewModel.cs
+++ b/EmbyStat.Controllers/Show/ShowStatisticsViewModel.cs
@@ -6,7 +6,7 @@ namespace EmbyStat.Controllers.Show;
public class ShowStatisticsViewModel
{
- public List> Cards { get; set; }
+ public List Cards { get; set; }
public List TopCards { get; set; }
public List BarCharts { get; set; }
public List PieCharts { get; set; }
diff --git a/EmbyStat.Core/DataStore/EsDbContext.cs b/EmbyStat.Core/DataStore/EsDbContext.cs
index 58296c157..9d0ae9f14 100644
--- a/EmbyStat.Core/DataStore/EsDbContext.cs
+++ b/EmbyStat.Core/DataStore/EsDbContext.cs
@@ -24,6 +24,7 @@ public class EsDbContext : IdentityDbContext
public DbSet MediaServerUsers { get; set; }
public DbSet Libraries { get; set; }
+ public DbSet LibrarySyncTypes { get; set; }
public DbSet Devices { get; set; }
public DbSet Filters { get; set; }
public DbSet Jobs { get; set; }
@@ -44,6 +45,7 @@ public EsDbContext(DbContextOptions options): base(options)
protected override void OnModelCreating(ModelBuilder builder)
{
+ BuildLibrary(builder);
BuildPeople(builder);
BuildMovies(builder);
BuildShows(builder);
@@ -61,6 +63,16 @@ protected override void OnModelCreating(ModelBuilder builder)
#region Builders
+ private static void BuildLibrary(ModelBuilder modelBuilder)
+ {
+ modelBuilder.Entity()
+ .HasMany(x => x.SyncTypes)
+ .WithOne(x => x.Library)
+ .HasForeignKey(x => x.LibraryId)
+ .IsRequired()
+ .OnDelete(DeleteBehavior.Cascade);
+ }
+
private static void BuildUserViews(ModelBuilder modelBuilder)
{
modelBuilder.Entity()
diff --git a/EmbyStat.Core/DataStore/Migrations/Sqlite/20220615060631_Init.Designer.cs b/EmbyStat.Core/DataStore/Migrations/Sqlite/20220622095519_Init.Designer.cs
similarity index 99%
rename from EmbyStat.Core/DataStore/Migrations/Sqlite/20220615060631_Init.Designer.cs
rename to EmbyStat.Core/DataStore/Migrations/Sqlite/20220622095519_Init.Designer.cs
index d60594ee0..349e82ac9 100644
--- a/EmbyStat.Core/DataStore/Migrations/Sqlite/20220615060631_Init.Designer.cs
+++ b/EmbyStat.Core/DataStore/Migrations/Sqlite/20220622095519_Init.Designer.cs
@@ -11,13 +11,13 @@
namespace EmbyStat.Core.DataStore.Migrations.Sqlite
{
[DbContext(typeof(EsDbContext))]
- [Migration("20220615060631_Init")]
+ [Migration("20220622095519_Init")]
partial class Init
{
protected override void BuildTargetModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
- modelBuilder.HasAnnotation("ProductVersion", "6.0.5");
+ modelBuilder.HasAnnotation("ProductVersion", "6.0.6");
modelBuilder.Entity("EmbyStat.Common.Models.Entities.Device", b =>
{
@@ -525,8 +525,8 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder)
b.Property("LastPlayedDate")
.HasColumnType("TEXT");
- b.Property("MediaType")
- .HasColumnType("TEXT");
+ b.Property("MediaType")
+ .HasColumnType("INTEGER");
b.Property("MovieId")
.HasColumnType("TEXT");
diff --git a/EmbyStat.Core/DataStore/Migrations/Sqlite/20220615060631_Init.cs b/EmbyStat.Core/DataStore/Migrations/Sqlite/20220622095519_Init.cs
similarity index 99%
rename from EmbyStat.Core/DataStore/Migrations/Sqlite/20220615060631_Init.cs
rename to EmbyStat.Core/DataStore/Migrations/Sqlite/20220622095519_Init.cs
index 566fbde6c..03858b76c 100644
--- a/EmbyStat.Core/DataStore/Migrations/Sqlite/20220615060631_Init.cs
+++ b/EmbyStat.Core/DataStore/Migrations/Sqlite/20220622095519_Init.cs
@@ -1,5 +1,4 @@
-using System;
-using Microsoft.EntityFrameworkCore.Migrations;
+using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
@@ -606,7 +605,7 @@ protected override void Up(MigrationBuilder migrationBuilder)
{
UserId = table.Column(type: "TEXT", nullable: false),
MediaId = table.Column(type: "TEXT", nullable: false),
- MediaType = table.Column(type: "TEXT", nullable: true),
+ MediaType = table.Column(type: "INTEGER", nullable: false),
PlayCount = table.Column(type: "INTEGER", nullable: false),
LastPlayedDate = table.Column(type: "TEXT", nullable: false),
EpisodeId = table.Column(type: "TEXT", nullable: true),
diff --git a/EmbyStat.Migrations/Sqlite/20220510134722_Init.Designer.cs b/EmbyStat.Core/DataStore/Migrations/Sqlite/20220711095301_SyncTypeAdded.Designer.cs
similarity index 98%
rename from EmbyStat.Migrations/Sqlite/20220510134722_Init.Designer.cs
rename to EmbyStat.Core/DataStore/Migrations/Sqlite/20220711095301_SyncTypeAdded.Designer.cs
index 141e04174..2c5011612 100644
--- a/EmbyStat.Migrations/Sqlite/20220510134722_Init.Designer.cs
+++ b/EmbyStat.Core/DataStore/Migrations/Sqlite/20220711095301_SyncTypeAdded.Designer.cs
@@ -8,16 +8,16 @@
#nullable disable
-namespace EmbyStat.Migrations.Sqlite
+namespace EmbyStat.Core.DataStore.Migrations.Sqlite
{
[DbContext(typeof(EsDbContext))]
- [Migration("20220510134722_Init")]
- partial class Init
+ [Migration("20220711095301_SyncTypeAdded")]
+ partial class SyncTypeAdded
{
protected override void BuildTargetModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
- modelBuilder.HasAnnotation("ProductVersion", "6.0.4");
+ modelBuilder.HasAnnotation("ProductVersion", "6.0.6");
modelBuilder.Entity("EmbyStat.Common.Models.Entities.Device", b =>
{
@@ -394,7 +394,7 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder)
b.Property("Primary")
.HasColumnType("TEXT");
- b.Property("Sync")
+ b.Property("SyncType")
.HasColumnType("INTEGER");
b.Property("Type")
@@ -525,8 +525,8 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder)
b.Property("LastPlayedDate")
.HasColumnType("TEXT");
- b.Property("MediaType")
- .HasColumnType("TEXT");
+ b.Property("MediaType")
+ .HasColumnType("INTEGER");
b.Property("MovieId")
.HasColumnType("TEXT");
@@ -599,8 +599,8 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder)
b.Property("TMDB")
.HasColumnType("INTEGER");
- b.Property("TVDB")
- .HasColumnType("TEXT");
+ b.Property("TVDB")
+ .HasColumnType("INTEGER");
b.Property("Thumb")
.HasColumnType("TEXT");
@@ -731,8 +731,8 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder)
b.Property("TMDB")
.HasColumnType("INTEGER");
- b.Property("TVDB")
- .HasColumnType("TEXT");
+ b.Property("TVDB")
+ .HasColumnType("INTEGER");
b.Property("Thumb")
.HasColumnType("TEXT");
@@ -864,8 +864,8 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder)
b.Property("TMDB")
.HasColumnType("INTEGER");
- b.Property("TVDB")
- .HasColumnType("TEXT");
+ b.Property("TVDB")
+ .HasColumnType("INTEGER");
b.Property("Thumb")
.HasColumnType("TEXT");
diff --git a/EmbyStat.Core/DataStore/Migrations/Sqlite/20220711095301_SyncTypeAdded.cs b/EmbyStat.Core/DataStore/Migrations/Sqlite/20220711095301_SyncTypeAdded.cs
new file mode 100644
index 000000000..56b82463a
--- /dev/null
+++ b/EmbyStat.Core/DataStore/Migrations/Sqlite/20220711095301_SyncTypeAdded.cs
@@ -0,0 +1,36 @@
+using Microsoft.EntityFrameworkCore.Migrations;
+
+#nullable disable
+
+namespace EmbyStat.Core.DataStore.Migrations.Sqlite
+{
+ public partial class SyncTypeAdded : Migration
+ {
+ protected override void Up(MigrationBuilder migrationBuilder)
+ {
+ migrationBuilder.DropColumn(
+ name: "Sync",
+ table: "Libraries");
+
+ migrationBuilder.AddColumn(
+ name: "SyncType",
+ table: "Libraries",
+ type: "INTEGER",
+ nullable: true);
+ }
+
+ protected override void Down(MigrationBuilder migrationBuilder)
+ {
+ migrationBuilder.DropColumn(
+ name: "SyncType",
+ table: "Libraries");
+
+ migrationBuilder.AddColumn(
+ name: "Sync",
+ table: "Libraries",
+ type: "INTEGER",
+ nullable: false,
+ defaultValue: false);
+ }
+ }
+}
diff --git a/EmbyStat.Core/DataStore/Migrations/Sqlite/20220712101203_MovedSyncTypeTable.Designer.cs b/EmbyStat.Core/DataStore/Migrations/Sqlite/20220712101203_MovedSyncTypeTable.Designer.cs
new file mode 100644
index 000000000..31fe93e5f
--- /dev/null
+++ b/EmbyStat.Core/DataStore/Migrations/Sqlite/20220712101203_MovedSyncTypeTable.Designer.cs
@@ -0,0 +1,1607 @@
+//
+using System;
+using EmbyStat.Core.DataStore;
+using Microsoft.EntityFrameworkCore;
+using Microsoft.EntityFrameworkCore.Infrastructure;
+using Microsoft.EntityFrameworkCore.Migrations;
+using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
+
+#nullable disable
+
+namespace EmbyStat.Core.DataStore.Migrations.Sqlite
+{
+ [DbContext(typeof(EsDbContext))]
+ [Migration("20220712101203_MovedSyncTypeTable")]
+ partial class MovedSyncTypeTable
+ {
+ protected override void BuildTargetModel(ModelBuilder modelBuilder)
+ {
+#pragma warning disable 612, 618
+ modelBuilder.HasAnnotation("ProductVersion", "6.0.6");
+
+ modelBuilder.Entity("EmbyStat.Common.Models.Entities.Device", b =>
+ {
+ b.Property("Id")
+ .HasColumnType("TEXT");
+
+ b.Property("AppName")
+ .HasColumnType("TEXT");
+
+ b.Property("AppVersion")
+ .HasColumnType("TEXT");
+
+ b.Property("DateLastActivity")
+ .HasColumnType("TEXT");
+
+ b.Property("IconUrl")
+ .HasColumnType("TEXT");
+
+ b.Property("LastUserId")
+ .HasColumnType("TEXT");
+
+ b.Property("LastUserName")
+ .HasColumnType("TEXT");
+
+ b.Property("Name")
+ .HasColumnType("TEXT");
+
+ b.HasKey("Id");
+
+ b.ToTable("Devices");
+ });
+
+ modelBuilder.Entity("EmbyStat.Common.Models.Entities.EmbyStatUser", b =>
+ {
+ b.Property("Id")
+ .HasColumnType("TEXT");
+
+ b.Property("AccessFailedCount")
+ .HasColumnType("INTEGER");
+
+ b.Property("ConcurrencyStamp")
+ .HasColumnType("TEXT");
+
+ b.Property("Email")
+ .HasColumnType("TEXT");
+
+ b.Property("EmailConfirmed")
+ .HasColumnType("INTEGER");
+
+ b.Property("LockoutEnabled")
+ .HasColumnType("INTEGER");
+
+ b.Property("LockoutEnd")
+ .HasColumnType("TEXT");
+
+ b.Property("NormalizedEmail")
+ .HasColumnType("TEXT");
+
+ b.Property("NormalizedUserName")
+ .HasColumnType("TEXT");
+
+ b.Property("PasswordHash")
+ .HasColumnType("TEXT");
+
+ b.Property("PhoneNumber")
+ .HasColumnType("TEXT");
+
+ b.Property("PhoneNumberConfirmed")
+ .HasColumnType("INTEGER");
+
+ b.Property("SecurityStamp")
+ .HasColumnType("TEXT");
+
+ b.Property("TwoFactorEnabled")
+ .HasColumnType("INTEGER");
+
+ b.Property("UserName")
+ .HasColumnType("TEXT");
+
+ b.Property("_refreshToken")
+ .HasColumnType("TEXT")
+ .HasColumnName("RefreshTokens");
+
+ b.HasKey("Id");
+
+ b.ToTable("Users");
+ });
+
+ modelBuilder.Entity("EmbyStat.Common.Models.Entities.FilterValues", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("INTEGER");
+
+ b.Property("Field")
+ .HasColumnType("TEXT");
+
+ b.Property("Type")
+ .HasColumnType("INTEGER");
+
+ b.Property("_Values")
+ .HasColumnType("TEXT")
+ .HasColumnName("Values");
+
+ b.HasKey("Id");
+
+ b.ToTable("Filters");
+ });
+
+ modelBuilder.Entity("EmbyStat.Common.Models.Entities.Genre", b =>
+ {
+ b.Property("Id")
+ .HasColumnType("TEXT");
+
+ b.Property("Name")
+ .HasColumnType("TEXT");
+
+ b.HasKey("Id");
+
+ b.HasIndex("Name");
+
+ b.ToTable("Genres");
+ });
+
+ modelBuilder.Entity("EmbyStat.Common.Models.Entities.Helpers.MediaPerson", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("INTEGER");
+
+ b.Property("MovieId")
+ .HasColumnType("TEXT");
+
+ b.Property("PersonId")
+ .IsRequired()
+ .HasColumnType("TEXT");
+
+ b.Property("ShowId")
+ .HasColumnType("TEXT");
+
+ b.Property("Type")
+ .HasColumnType("INTEGER");
+
+ b.HasKey("Id");
+
+ b.HasIndex("MovieId");
+
+ b.HasIndex("PersonId");
+
+ b.HasIndex("ShowId");
+
+ b.ToTable("MediaPerson");
+ });
+
+ modelBuilder.Entity("EmbyStat.Common.Models.Entities.Job", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("TEXT");
+
+ b.Property("CurrentProgressPercentage")
+ .HasColumnType("REAL");
+
+ b.Property("Description")
+ .HasColumnType("TEXT");
+
+ b.Property("EndTimeUtc")
+ .HasColumnType("TEXT");
+
+ b.Property("StartTimeUtc")
+ .HasColumnType("TEXT");
+
+ b.Property("State")
+ .HasColumnType("INTEGER");
+
+ b.Property("Title")
+ .HasColumnType("TEXT");
+
+ b.Property("Trigger")
+ .HasColumnType("TEXT");
+
+ b.HasKey("Id");
+
+ b.ToTable("Jobs");
+
+ b.HasData(
+ new
+ {
+ Id = new Guid("78bc2bf0-abd9-48ef-aeff-9c396d644f2a"),
+ CurrentProgressPercentage = 0.0,
+ Description = "UPDATE-CHECKERDESCRIPTION",
+ State = 0,
+ Title = "UPDATE-CHECKER",
+ Trigger = "0 */12 * * *"
+ },
+ new
+ {
+ Id = new Guid("41e0bf22-1e6b-4f5d-90be-ec966f746a2f"),
+ CurrentProgressPercentage = 0.0,
+ Description = "SYSTEM-SYNCDESCRIPTION",
+ State = 0,
+ Title = "SYSTEM-SYNC",
+ Trigger = "0 2 * * *"
+ },
+ new
+ {
+ Id = new Guid("be68900b-ee1d-41ef-b12f-60ef3106052e"),
+ CurrentProgressPercentage = 0.0,
+ Description = "SHOW-SYNCDESCRIPTION",
+ State = 0,
+ Title = "SHOW-SYNC",
+ Trigger = "0 3 * * *"
+ },
+ new
+ {
+ Id = new Guid("ce1fbc9e-21ee-450b-9cdf-58a0e17ea98e"),
+ CurrentProgressPercentage = 0.0,
+ Description = "PINGDESCRIPTION",
+ State = 0,
+ Title = "PING",
+ Trigger = "*/5 * * * *"
+ },
+ new
+ {
+ Id = new Guid("b109ca73-0563-4062-a3e2-f7e6a00b73e9"),
+ CurrentProgressPercentage = 0.0,
+ Description = "DATABASE-CLEANUPDESCRIPTION",
+ State = 0,
+ Title = "DATABASE-CLEANUP",
+ Trigger = "0 4 * * *"
+ },
+ new
+ {
+ Id = new Guid("c40555dc-ea57-4c6e-a225-905223d31c3c"),
+ CurrentProgressPercentage = 0.0,
+ Description = "MOVIE-SYNCDESCRIPTION",
+ State = 0,
+ Title = "MOVIE-SYNC",
+ Trigger = "0 2 * * *"
+ });
+ });
+
+ modelBuilder.Entity("EmbyStat.Common.Models.Entities.Language", b =>
+ {
+ b.Property("Id")
+ .HasColumnType("TEXT");
+
+ b.Property("Code")
+ .HasColumnType("TEXT");
+
+ b.Property("Name")
+ .HasColumnType("TEXT");
+
+ b.HasKey("Id");
+
+ b.ToTable("Languages");
+
+ b.HasData(
+ new
+ {
+ Id = "e1940bfd-00c4-46f9-b9ac-a87a5d92e8ca",
+ Code = "da-DK",
+ Name = "Dansk"
+ },
+ new
+ {
+ Id = "c9df5e5c-75f3-46c2-8095-97fde33531d8",
+ Code = "de-DE",
+ Name = "Deutsch"
+ },
+ new
+ {
+ Id = "d6401f6b-becf-49e2-b82e-1018b3bf607f",
+ Code = "el-GR",
+ Name = "Ελληνικά"
+ },
+ new
+ {
+ Id = "62fe1b5e-3328-450b-b24b-fa16bea58870",
+ Code = "en-US",
+ Name = "English"
+ },
+ new
+ {
+ Id = "c0a60a3b-282e-46f5-aa7f-661c88f2edb0",
+ Code = "es-ES",
+ Name = "Español"
+ },
+ new
+ {
+ Id = "91cca672-af55-4d55-899a-798826a43773",
+ Code = "fi-FI",
+ Name = "Suomi"
+ },
+ new
+ {
+ Id = "99142c2f-379e-4a25-879b-ecfe25ee9e7c",
+ Code = "fr-FR",
+ Name = "Français"
+ },
+ new
+ {
+ Id = "a48a2ef9-3b64-4069-8e31-252abb6d07a3",
+ Code = "hu-HU",
+ Name = "Magyar"
+ },
+ new
+ {
+ Id = "282182b9-9332-4266-a093-5ff5b7f927a9",
+ Code = "it-IT",
+ Name = "Italiano"
+ },
+ new
+ {
+ Id = "082d8aaf-f86a-4401-bf0f-c315b3c9d904",
+ Code = "nl-NL",
+ Name = "Nederlands"
+ },
+ new
+ {
+ Id = "d8b0ae7b-9ba7-4a51-9d7c-94402b51265d",
+ Code = "no-NO",
+ Name = "Norsk"
+ },
+ new
+ {
+ Id = "f3966f43-3ec6-456e-850f-a2ebfc0b539b",
+ Code = "pl-PL",
+ Name = "Polski"
+ },
+ new
+ {
+ Id = "b21074db-74b9-4e24-8867-34e82c265256",
+ Code = "pt-BR",
+ Name = "Brasileiro"
+ },
+ new
+ {
+ Id = "490c1cb5-b711-4514-aa97-d22ddff2b2fa",
+ Code = "pt-PT",
+ Name = "Português"
+ },
+ new
+ {
+ Id = "6b103b14-20d1-49c0-b7ce-8d701399b64d",
+ Code = "ro-RO",
+ Name = "Românesc"
+ },
+ new
+ {
+ Id = "3e8d27e9-e314-4d57-967f-cf5d84144acf",
+ Code = "sv-SE",
+ Name = "Svenska"
+ },
+ new
+ {
+ Id = "97616a9b-60f9-407a-9a87-b4518da5e5f4",
+ Code = "zh-CN",
+ Name = "简体中文"
+ });
+ });
+
+ modelBuilder.Entity("EmbyStat.Common.Models.Entities.Library", b =>
+ {
+ b.Property("Id")
+ .HasColumnType("TEXT");
+
+ b.Property("LastSynced")
+ .HasColumnType("TEXT");
+
+ b.Property("Name")
+ .HasColumnType("TEXT");
+
+ b.Property("Primary")
+ .HasColumnType("TEXT");
+
+ b.Property("SyncType")
+ .HasColumnType("INTEGER");
+
+ b.Property("Type")
+ .HasColumnType("INTEGER");
+
+ b.HasKey("Id");
+
+ b.ToTable("Libraries");
+ });
+
+ modelBuilder.Entity("EmbyStat.Common.Models.Entities.LibrarySyncType", b =>
+ {
+ b.Property("Id")
+ .HasColumnType("TEXT");
+
+ b.Property("LibraryId")
+ .IsRequired()
+ .HasColumnType("TEXT");
+
+ b.Property("SyncType")
+ .HasColumnType("INTEGER");
+
+ b.HasKey("Id");
+
+ b.HasIndex("LibraryId");
+
+ b.ToTable("LibrarySyncType");
+ });
+
+ modelBuilder.Entity("EmbyStat.Common.Models.Entities.MediaServerInfo", b =>
+ {
+ b.Property("Id")
+ .HasColumnType("TEXT");
+
+ b.Property("CachePath")
+ .HasColumnType("TEXT");
+
+ b.Property("CanLaunchWebBrowser")
+ .HasColumnType("INTEGER");
+
+ b.Property("CanSelfRestart")
+ .HasColumnType("INTEGER");
+
+ b.Property("CanSelfUpdate")
+ .HasColumnType("INTEGER");
+
+ b.Property("HardwareAccelerationRequiresPremiere")
+ .HasColumnType("INTEGER");
+
+ b.Property("HasPendingRestart")
+ .HasColumnType("INTEGER");
+
+ b.Property("HasUpdateAvailable")
+ .HasColumnType("INTEGER");
+
+ b.Property("HttpServerPortNumber")
+ .HasColumnType("INTEGER");
+
+ b.Property("HttpsPortNumber")
+ .HasColumnType("INTEGER");
+
+ b.Property("InternalMetadataPath")
+ .HasColumnType("TEXT");
+
+ b.Property("ItemsByNamePath")
+ .HasColumnType("TEXT");
+
+ b.Property("LocalAddress")
+ .HasColumnType("TEXT");
+
+ b.Property("LogPath")
+ .HasColumnType("TEXT");
+
+ b.Property("OperatingSystem")
+ .HasColumnType("TEXT");
+
+ b.Property("OperatingSystemDisplayName")
+ .HasColumnType("TEXT");
+
+ b.Property("ProgramDataPath")
+ .HasColumnType("TEXT");
+
+ b.Property("ServerName")
+ .HasColumnType("TEXT");
+
+ b.Property("SupportsAutoRunAtStartup")
+ .HasColumnType("INTEGER");
+
+ b.Property("SupportsHttps")
+ .HasColumnType("INTEGER");
+
+ b.Property("SupportsLibraryMonitor")
+ .HasColumnType("INTEGER");
+
+ b.Property("SystemUpdateLevel")
+ .HasColumnType("TEXT");
+
+ b.Property("TranscodingTempPath")
+ .HasColumnType("TEXT");
+
+ b.Property("Version")
+ .HasColumnType("TEXT");
+
+ b.Property("WanAddress")
+ .HasColumnType("TEXT");
+
+ b.Property("WebSocketPortNumber")
+ .HasColumnType("INTEGER");
+
+ b.HasKey("Id");
+
+ b.ToTable("MediaServerInfo");
+ });
+
+ modelBuilder.Entity("EmbyStat.Common.Models.Entities.MediaServerStatus", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("TEXT");
+
+ b.Property("MissedPings")
+ .HasColumnType("INTEGER");
+
+ b.HasKey("Id");
+
+ b.ToTable("MediaServerStatus");
+
+ b.HasData(
+ new
+ {
+ Id = new Guid("e55668a1-6a81-47ba-882d-738347e7e9cd"),
+ MissedPings = 0
+ });
+ });
+
+ modelBuilder.Entity("EmbyStat.Common.Models.Entities.MediaServerUserView", b =>
+ {
+ b.Property("UserId")
+ .HasColumnType("TEXT");
+
+ b.Property("MediaId")
+ .HasColumnType("TEXT");
+
+ b.Property("EpisodeId")
+ .HasColumnType("TEXT");
+
+ b.Property("LastPlayedDate")
+ .HasColumnType("TEXT");
+
+ b.Property("MediaType")
+ .HasColumnType("INTEGER");
+
+ b.Property("MovieId")
+ .HasColumnType("TEXT");
+
+ b.Property("PlayCount")
+ .HasColumnType("INTEGER");
+
+ b.HasKey("UserId", "MediaId");
+
+ b.HasIndex("EpisodeId");
+
+ b.HasIndex("MovieId");
+
+ b.ToTable("MediaServerUserViews");
+ });
+
+ modelBuilder.Entity("EmbyStat.Common.Models.Entities.Movies.Movie", b =>
+ {
+ b.Property("Id")
+ .HasColumnType("TEXT");
+
+ b.Property("Banner")
+ .HasColumnType("TEXT");
+
+ b.Property("CommunityRating")
+ .HasColumnType("TEXT");
+
+ b.Property("Container")
+ .HasColumnType("TEXT");
+
+ b.Property("DateCreated")
+ .HasColumnType("TEXT");
+
+ b.Property("IMDB")
+ .HasColumnType("TEXT");
+
+ b.Property("LibraryId")
+ .HasColumnType("TEXT");
+
+ b.Property("Logo")
+ .HasColumnType("TEXT");
+
+ b.Property("Name")
+ .HasColumnType("TEXT");
+
+ b.Property("OfficialRating")
+ .HasColumnType("TEXT");
+
+ b.Property("OriginalTitle")
+ .HasColumnType("TEXT");
+
+ b.Property("Path")
+ .HasColumnType("TEXT");
+
+ b.Property("PremiereDate")
+ .HasColumnType("TEXT");
+
+ b.Property("Primary")
+ .HasColumnType("TEXT");
+
+ b.Property("ProductionYear")
+ .HasColumnType("INTEGER");
+
+ b.Property("RunTimeTicks")
+ .HasColumnType("INTEGER");
+
+ b.Property("SortName")
+ .HasColumnType("TEXT");
+
+ b.Property("TMDB")
+ .HasColumnType("INTEGER");
+
+ b.Property("TVDB")
+ .HasColumnType("INTEGER");
+
+ b.Property("Thumb")
+ .HasColumnType("TEXT");
+
+ b.Property("Video3DFormat")
+ .HasColumnType("INTEGER");
+
+ b.HasKey("Id");
+
+ b.HasIndex("CommunityRating");
+
+ b.HasIndex("LibraryId");
+
+ b.HasIndex("Logo");
+
+ b.HasIndex("Name");
+
+ b.HasIndex("Primary");
+
+ b.HasIndex("RunTimeTicks");
+
+ b.HasIndex("SortName");
+
+ b.ToTable("Movies");
+ });
+
+ modelBuilder.Entity("EmbyStat.Common.Models.Entities.Person", b =>
+ {
+ b.Property("Id")
+ .HasColumnType("TEXT");
+
+ b.Property("Name")
+ .HasColumnType("TEXT");
+
+ b.Property("Primary")
+ .HasColumnType("TEXT");
+
+ b.HasKey("Id");
+
+ b.ToTable("People");
+ });
+
+ modelBuilder.Entity("EmbyStat.Common.Models.Entities.PluginInfo", b =>
+ {
+ b.Property("Id")
+ .HasColumnType("TEXT");
+
+ b.Property("Description")
+ .HasColumnType("TEXT");
+
+ b.Property("Name")
+ .HasColumnType("TEXT");
+
+ b.Property("Version")
+ .HasColumnType("TEXT");
+
+ b.HasKey("Id");
+
+ b.ToTable("Plugins");
+ });
+
+ modelBuilder.Entity("EmbyStat.Common.Models.Entities.Shows.Episode", b =>
+ {
+ b.Property("Id")
+ .HasColumnType("TEXT");
+
+ b.Property("Banner")
+ .HasColumnType("TEXT");
+
+ b.Property("CommunityRating")
+ .HasColumnType("TEXT");
+
+ b.Property("Container")
+ .HasColumnType("TEXT");
+
+ b.Property("DateCreated")
+ .HasColumnType("TEXT");
+
+ b.Property("DvdEpisodeNumber")
+ .HasColumnType("REAL");
+
+ b.Property("DvdSeasonNumber")
+ .HasColumnType("INTEGER");
+
+ b.Property("IMDB")
+ .HasColumnType("TEXT");
+
+ b.Property("IndexNumber")
+ .HasColumnType("INTEGER");
+
+ b.Property("IndexNumberEnd")
+ .HasColumnType("INTEGER");
+
+ b.Property("LocationType")
+ .HasColumnType("INTEGER");
+
+ b.Property("Logo")
+ .HasColumnType("TEXT");
+
+ b.Property("Name")
+ .HasColumnType("TEXT");
+
+ b.Property("OfficialRating")
+ .HasColumnType("TEXT");
+
+ b.Property("Path")
+ .HasColumnType("TEXT");
+
+ b.Property("PremiereDate")
+ .HasColumnType("TEXT");
+
+ b.Property("Primary")
+ .HasColumnType("TEXT");
+
+ b.Property("ProductionYear")
+ .HasColumnType("INTEGER");
+
+ b.Property("RunTimeTicks")
+ .HasColumnType("INTEGER");
+
+ b.Property("SeasonId")
+ .IsRequired()
+ .HasColumnType("TEXT");
+
+ b.Property("SortName")
+ .HasColumnType("TEXT");
+
+ b.Property("TMDB")
+ .HasColumnType("INTEGER");
+
+ b.Property