Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
Jamie.Rees authored and Jamie.Rees committed Mar 10, 2017
1 parent 6353662 commit 706fc94
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 23 deletions.
16 changes: 14 additions & 2 deletions Ombi.Services/Jobs/EmbyContentCacher.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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<EmbyContent>();
});
foreach (var m in movies)
{
if (m.Type.Equals("boxset", StringComparison.CurrentCultureIgnoreCase))
Expand All @@ -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<EmbyContent>();
});
foreach (var t in tv)
{
var tvInfo = EmbyApi.GetInformation(t.Id, EmbyMediaType.Series, embySettings.ApiKey,
Expand Down
42 changes: 21 additions & 21 deletions Ombi.Services/Jobs/PlexContentCacher.cs
Original file line number Diff line number Diff line change
Expand Up @@ -239,13 +239,13 @@ private List<PlexSearch> 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<PlexContent>();
//});
// 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<PlexContent>();
});

foreach (var m in movies)
{
Expand Down Expand Up @@ -280,13 +280,13 @@ private List<PlexSearch> 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<PlexContent>();
//});
// 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<PlexContent>();
});
foreach (var t in tv)
{
if (string.IsNullOrEmpty(t.ProviderId))
Expand Down Expand Up @@ -321,13 +321,13 @@ private List<PlexSearch> 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<PlexContent>();
//});
// 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<PlexContent>();
});

foreach (var a in albums)
{
Expand Down

0 comments on commit 706fc94

Please sign in to comment.