Another newsletter fix attempt #1163 #1116

This commit is contained in:
tidusjar 2017-03-06 21:33:23 +00:00
commit dfbe01b3bf
2 changed files with 24 additions and 1 deletions

View file

@ -115,7 +115,7 @@ namespace Ombi.Services.Jobs
foreach (var item in info.Items) foreach (var item in info.Items)
{ {
var movieInfo = EmbyApi.GetInformation(item.Id, EmbyMediaType.Movie, embySettings.ApiKey, var movieInfo = EmbyApi.GetInformation(item.Id, EmbyMediaType.Movie, embySettings.ApiKey,
embySettings.AdministratorId, embySettings.FullUri).MovieInformation; embySettings.AdministratorId, embySettings.FullUri).MovieInformation;
ProcessMovies(movieInfo); ProcessMovies(movieInfo);
} }
} }
@ -149,6 +149,12 @@ namespace Ombi.Services.Jobs
connection.Dispose(); connection.Dispose();
return media; return media;
}); });
if (item != null && item.EmbyId != t.Id)
{
// delete this item since the Id has changed
EmbyContent.Delete(item);
item = null;
}
if (item == null) if (item == null)
{ {
@ -255,6 +261,13 @@ namespace Ombi.Services.Jobs
return media; return media;
}); });
if (item != null && item.EmbyId != movieInfo.Id)
{
// delete this item since the Id has changed
EmbyContent.Delete(item);
item = null;
}
if (item == null) if (item == null)
{ {
// Doesn't exist, insert it // Doesn't exist, insert it

View file

@ -81,6 +81,7 @@ namespace Ombi.Services.Jobs
continue; continue;
} }
// Check it this episode exists // Check it this episode exists
var item = Repo.Custom(connection => var item = Repo.Custom(connection =>
{ {
@ -93,6 +94,15 @@ namespace Ombi.Services.Jobs
return media; return media;
}); });
if (item != null)
{
if (item.EmbyId != ep.Id) // The id's dont match, delete it
{
Repo.Delete(item);
item = null;
}
}
if (item == null) if (item == null)
{ {
// add it // add it