Skip to content

Commit

Permalink
Change to using both string and list for guids (guid/guids) to preven…
Browse files Browse the repository at this point in the history
…t conflict #4720
  • Loading branch information
Berserkir-Wolf committed Aug 17, 2022
1 parent c6bf08a commit 21903e2
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/Ombi.Api.Plex/Models/Metadata.cs
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public class Metadata
public string grandparentTheme { get; set; }
public string chapterSource { get; set; }
public Medium[] Media { get; set; }
public List<PlexGuids> Guid { get; set; } = new List<PlexGuids>();
public List<PlexGuids> Guids { get; set; } = new List<PlexGuids>();
// public Director[] Director { get; set; }
// public Writer[] Writer { get; set; }
}
Expand Down
12 changes: 6 additions & 6 deletions src/Ombi.Schedule/Jobs/Plex/PlexContentSync.cs
Original file line number Diff line number Diff line change
Expand Up @@ -318,16 +318,16 @@ public async Task MovieLoop(PlexServers servers, Mediacontainer content, HashSet

Logger.LogDebug("Adding movie {0}", movie.title);
var guids = new List<string>();
if (!movie.Guid.Any())
if (!movie.Guids.Any())
{
var metaData = await PlexApi.GetMetadata(servers.PlexAuthToken, servers.FullUri,
movie.ratingKey);

var meta = metaData.MediaContainer.Metadata.FirstOrDefault();
guids.Add(meta.guid);
if (meta.Guid != null)
if (meta.Guids != null)
{
foreach (var g in meta.Guid)
foreach (var g in meta.Guids)
{
guids.Add(g.Id);
}
Expand All @@ -336,7 +336,7 @@ public async Task MovieLoop(PlexServers servers, Mediacontainer content, HashSet
else
{
// Currently a Plex Pass feature only
foreach (var g in movie.Guid)
foreach (var g in movie.Guids)
{
guids.Add(g.Id);
}
Expand Down Expand Up @@ -607,9 +607,9 @@ private async Task GetProviderIds(PlexMetadata showMetadata, PlexServerContent e
{
metadata.guid
};
if (metadata.Guid != null)
if (metadata.Guids != null)
{
foreach (var g in metadata.Guid)
foreach (var g in metadata.Guids)
{
guids.Add(g.Id);
}
Expand Down

0 comments on commit 21903e2

Please sign in to comment.