Another newsletter fix attempt #1163 #1116

pull/1215/head
tidusjar 8 years ago
parent 82c1fb79ed
commit dfbe01b3bf

@ -115,7 +115,7 @@ namespace Ombi.Services.Jobs
foreach (var item in info.Items)
{
var movieInfo = EmbyApi.GetInformation(item.Id, EmbyMediaType.Movie, embySettings.ApiKey,
embySettings.AdministratorId, embySettings.FullUri).MovieInformation;
embySettings.AdministratorId, embySettings.FullUri).MovieInformation;
ProcessMovies(movieInfo);
}
}
@ -149,6 +149,12 @@ namespace Ombi.Services.Jobs
connection.Dispose();
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)
{
@ -255,6 +261,13 @@ namespace Ombi.Services.Jobs
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)
{
// Doesn't exist, insert it

@ -81,6 +81,7 @@ namespace Ombi.Services.Jobs
continue;
}
// Check it this episode exists
var item = Repo.Custom(connection =>
{
@ -93,6 +94,15 @@ namespace Ombi.Services.Jobs
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)
{
// add it

Loading…
Cancel
Save