diff --git a/Ombi.Services/Jobs/EmbyContentCacher.cs b/Ombi.Services/Jobs/EmbyContentCacher.cs index ce8acdc0e..8e1011aec 100644 --- a/Ombi.Services/Jobs/EmbyContentCacher.cs +++ b/Ombi.Services/Jobs/EmbyContentCacher.cs @@ -105,7 +105,13 @@ private void CachedLibraries(EmbySettings embySettings) try { var movies = GetMovies(); - + // Delete everything + EmbyContent.Custom(connection => + { + connection.Open(); + connection.Query("delete from EmbyContent where type = @type", new { type = 0 }); + return new List(); + }); foreach (var m in movies) { if (m.Type.Equals("boxset", StringComparison.CurrentCultureIgnoreCase)) @@ -129,7 +135,13 @@ private void CachedLibraries(EmbySettings embySettings) } var tv = GetTvShows(); - + // Delete everything + EmbyContent.Custom(connection => + { + connection.Open(); + connection.Query("delete from EmbyContent where type = @type", new { type = 1 }); + return new List(); + }); foreach (var t in tv) { var tvInfo = EmbyApi.GetInformation(t.Id, EmbyMediaType.Series, embySettings.ApiKey, diff --git a/Ombi.Services/Jobs/PlexContentCacher.cs b/Ombi.Services/Jobs/PlexContentCacher.cs index f370b7b36..6878c3367 100644 --- a/Ombi.Services/Jobs/PlexContentCacher.cs +++ b/Ombi.Services/Jobs/PlexContentCacher.cs @@ -239,13 +239,13 @@ private List CachedLibraries(PlexSettings plexSettings) var movies = GetPlexMovies(results); - //// Time to destroy the plex movies from the DB - //PlexContent.Custom(connection => - //{ - // connection.Open(); - // connection.Query("delete from PlexContent where type = @type", new { type = 0 }); - // return new List(); - //}); + // Time to destroy the plex movies from the DB + PlexContent.Custom(connection => + { + connection.Open(); + connection.Query("delete from PlexContent where type = @type", new { type = 0 }); + return new List(); + }); foreach (var m in movies) { @@ -280,13 +280,13 @@ private List CachedLibraries(PlexSettings plexSettings) } var tv = GetPlexTvShows(results); - //// Time to destroy the plex tv from the DB - //PlexContent.Custom(connection => - //{ - // connection.Open(); - // connection.Query("delete from PlexContent where type = @type", new { type = 1 }); - // return new List(); - //}); + // Time to destroy the plex tv from the DB + PlexContent.Custom(connection => + { + connection.Open(); + connection.Query("delete from PlexContent where type = @type", new { type = 1 }); + return new List(); + }); foreach (var t in tv) { if (string.IsNullOrEmpty(t.ProviderId)) @@ -321,13 +321,13 @@ private List CachedLibraries(PlexSettings plexSettings) } var albums = GetPlexAlbums(results); - //// Time to destroy the plex movies from the DB - //PlexContent.Custom(connection => - //{ - // connection.Open(); - // connection.Query("delete from PlexContent where type = @type", new { type = 2 }); - // return new List(); - //}); + // Time to destroy the plex movies from the DB + PlexContent.Custom(connection => + { + connection.Open(); + connection.Query("delete from PlexContent where type = @type", new { type = 2 }); + return new List(); + }); foreach (var a in albums) {