Fixed: Ignore invalid movie tags when writing XBMC metadata

Co-authored-by: Mark McDowall <mark@mcdowall.ca>

Fixes #9984
pull/9991/head
Bogdan 5 months ago
parent 649702eaca
commit c9624e7550

@ -294,7 +294,7 @@ namespace NzbDrone.Core.Extras.Metadata.Consumers.Xbmc
if (movie.Tags.Any()) if (movie.Tags.Any())
{ {
var tags = _tagRepository.Get(movie.Tags); var tags = _tagRepository.GetTags(movie.Tags);
foreach (var tag in tags) foreach (var tag in tags)
{ {

@ -1,4 +1,5 @@
using System; using System;
using System.Collections.Generic;
using System.Linq; using System.Linq;
using NzbDrone.Core.Datastore; using NzbDrone.Core.Datastore;
using NzbDrone.Core.Messaging.Events; using NzbDrone.Core.Messaging.Events;
@ -9,6 +10,7 @@ namespace NzbDrone.Core.Tags
{ {
Tag GetByLabel(string label); Tag GetByLabel(string label);
Tag FindByLabel(string label); Tag FindByLabel(string label);
List<Tag> GetTags(HashSet<int> tagIds);
} }
public class TagRepository : BasicRepository<Tag>, ITagRepository public class TagRepository : BasicRepository<Tag>, ITagRepository
@ -34,5 +36,10 @@ namespace NzbDrone.Core.Tags
{ {
return Query(x => x.Label == label).SingleOrDefault(); return Query(x => x.Label == label).SingleOrDefault();
} }
public List<Tag> GetTags(HashSet<int> tagIds)
{
return Query(t => tagIds.Contains(t.Id));
}
} }
} }

Loading…
Cancel
Save