fix(emby/jellyfin): 🐛 A more reliable Emby and Jellyfin sync [skip ci]

* Fix 100th Emby episode not being synced

Emby API is zero-based offset

* Fix 100th Emby TV show and movie not being synced

* Fix Jellyfin API offset error
pull/4470/head
sephrat 3 years ago committed by GitHub
parent 35806ea2d2
commit ad677fa02e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -143,7 +143,7 @@ namespace Ombi.Schedule.Jobs.Emby
tv = await Api.GetAllShows(server.ApiKey, parentId, 0, AmountToTake, server.AdministratorId, server.FullUri);
}
var totalTv = tv.TotalRecordCount;
var processed = 1;
var processed = 0;
while (processed < totalTv)
{
foreach (var tvShow in tv.Items)
@ -207,7 +207,7 @@ namespace Ombi.Schedule.Jobs.Emby
movies = await Api.GetAllMovies(server.ApiKey, parentId, 0, AmountToTake, server.AdministratorId, server.FullUri);
}
var totalCount = movies.TotalRecordCount;
var processed = 1;
var processed = 0;
var mediaToAdd = new HashSet<EmbyContent>();
while (processed < totalCount)
{

@ -122,7 +122,7 @@ namespace Ombi.Schedule.Jobs.Emby
allEpisodes = await Api.GetAllEpisodes(server.ApiKey, parentIdFilter, 0, AmountToTake, server.AdministratorId, server.FullUri);
}
var total = allEpisodes.TotalRecordCount;
var processed = 1;
var processed = 0;
var epToAdd = new HashSet<EmbyEpisode>();
while (processed < total)
{

@ -118,7 +118,7 @@ namespace Ombi.Schedule.Jobs.Jellyfin
var mediaToAdd = new HashSet<JellyfinContent>();
var tv = await Api.GetAllShows(server.ApiKey, parentId, 0, 200, server.AdministratorId, server.FullUri);
var totalTv = tv.TotalRecordCount;
var processed = 1;
var processed = 0;
while (processed < totalTv)
{
foreach (var tvShow in tv.Items)
@ -177,7 +177,7 @@ namespace Ombi.Schedule.Jobs.Jellyfin
{
var movies = await Api.GetAllMovies(server.ApiKey, parentId, 0, 200, server.AdministratorId, server.FullUri);
var totalCount = movies.TotalRecordCount;
var processed = 1;
var processed = 0;
var mediaToAdd = new HashSet<JellyfinContent>();
while (processed < totalCount)
{

@ -98,7 +98,7 @@ namespace Ombi.Schedule.Jobs.Jellyfin
{
var allEpisodes = await Api.GetAllEpisodes(server.ApiKey, parentIdFilter, 0, 200, server.AdministratorId, server.FullUri);
var total = allEpisodes.TotalRecordCount;
var processed = 1;
var processed = 0;
var epToAdd = new HashSet<JellyfinEpisode>();
while (processed < total)
{

Loading…
Cancel
Save