mirror of
https://github.com/Ombi-app/Ombi.git
synced 2025-08-23 06:25:24 -07:00
Fix broken integration with Plex libraries
This commit is contained in:
parent
3fd43a9845
commit
26177e5236
3 changed files with 41 additions and 4 deletions
|
@ -182,7 +182,7 @@ namespace Ombi.Schedule.Jobs.Plex
|
||||||
foreach (var content in allContent.OrderByDescending(x => x.viewGroup))
|
foreach (var content in allContent.OrderByDescending(x => x.viewGroup))
|
||||||
{
|
{
|
||||||
Logger.LogDebug($"Got type '{content.viewGroup}' to process");
|
Logger.LogDebug($"Got type '{content.viewGroup}' to process");
|
||||||
if (content.viewGroup.Equals(MediaType.Episode.ToString(), StringComparison.InvariantCultureIgnoreCase))
|
if (content.viewGroup.Equals(PlexMediaType.Episode.ToString(), StringComparison.InvariantCultureIgnoreCase))
|
||||||
{
|
{
|
||||||
Logger.LogDebug("Found some episodes, this must be a recently added sync");
|
Logger.LogDebug("Found some episodes, this must be a recently added sync");
|
||||||
var count = 0;
|
var count = 0;
|
||||||
|
@ -230,7 +230,7 @@ namespace Ombi.Schedule.Jobs.Plex
|
||||||
episodesProcessed.AddRange(episodesAdded.Select(x => x.Id));
|
episodesProcessed.AddRange(episodesAdded.Select(x => x.Id));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (content.viewGroup.Equals(MediaType.Series.ToString(), StringComparison.InvariantCultureIgnoreCase))
|
if (content.viewGroup.Equals(PlexMediaType.Show.ToString(), StringComparison.InvariantCultureIgnoreCase))
|
||||||
{
|
{
|
||||||
// Process Shows
|
// Process Shows
|
||||||
Logger.LogDebug("Processing TV Shows");
|
Logger.LogDebug("Processing TV Shows");
|
||||||
|
@ -260,7 +260,7 @@ namespace Ombi.Schedule.Jobs.Plex
|
||||||
|
|
||||||
await Repo.SaveChangesAsync();
|
await Repo.SaveChangesAsync();
|
||||||
}
|
}
|
||||||
if (content.viewGroup.Equals(MediaType.Movie.ToString(), StringComparison.InvariantCultureIgnoreCase))
|
if (content.viewGroup.Equals(PlexMediaType.Movie.ToString(), StringComparison.InvariantCultureIgnoreCase))
|
||||||
{
|
{
|
||||||
await MovieLoop(servers, content, contentToAdd, contentProcessed);
|
await MovieLoop(servers, content, contentToAdd, contentProcessed);
|
||||||
}
|
}
|
||||||
|
|
|
@ -83,7 +83,7 @@ namespace Ombi.Schedule.Jobs.Plex
|
||||||
var sections = await _api.GetLibrarySections(settings.PlexAuthToken, settings.FullUri);
|
var sections = await _api.GetLibrarySections(settings.PlexAuthToken, settings.FullUri);
|
||||||
|
|
||||||
// Filter the libSections
|
// Filter the libSections
|
||||||
var tvSections = sections.MediaContainer.Directory.Where(x => x.type.Equals(MediaType.Series.ToString(), StringComparison.CurrentCultureIgnoreCase));
|
var tvSections = sections.MediaContainer.Directory.Where(x => x.type.Equals(PlexMediaType.Show.ToString(), StringComparison.CurrentCultureIgnoreCase));
|
||||||
|
|
||||||
foreach (var section in tvSections)
|
foreach (var section in tvSections)
|
||||||
{
|
{
|
||||||
|
|
37
src/Ombi.Schedule/Jobs/Plex/PlexMediaType.cs
Normal file
37
src/Ombi.Schedule/Jobs/Plex/PlexMediaType.cs
Normal file
|
@ -0,0 +1,37 @@
|
||||||
|
#region Copyright
|
||||||
|
// /************************************************************************
|
||||||
|
// Copyright (c) 2017 Jamie Rees
|
||||||
|
// File: PlexContentCacher.cs
|
||||||
|
// Created By: Jamie Rees
|
||||||
|
//
|
||||||
|
// Permission is hereby granted, free of charge, to any person obtaining
|
||||||
|
// a copy of this software and associated documentation files (the
|
||||||
|
// "Software"), to deal in the Software without restriction, including
|
||||||
|
// without limitation the rights to use, copy, modify, merge, publish,
|
||||||
|
// distribute, sublicense, and/or sell copies of the Software, and to
|
||||||
|
// permit persons to whom the Software is furnished to do so, subject to
|
||||||
|
// the following conditions:
|
||||||
|
//
|
||||||
|
// The above copyright notice and this permission notice shall be
|
||||||
|
// included in all copies or substantial portions of the Software.
|
||||||
|
//
|
||||||
|
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||||
|
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||||
|
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||||
|
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
||||||
|
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
||||||
|
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
||||||
|
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
|
// ************************************************************************/
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
|
||||||
|
namespace Ombi.Schedule.Jobs
|
||||||
|
{
|
||||||
|
public enum PlexMediaType
|
||||||
|
{
|
||||||
|
Movie = 0,
|
||||||
|
Show = 1,
|
||||||
|
Episode = 2,
|
||||||
|
}
|
||||||
|
}
|
Loading…
Add table
Add a link
Reference in a new issue