Fixed: Ignore invalid movie tags when writing XBMC metadata

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

Fixes #9984
This commit is contained in:
Bogdan 2024-05-08 04:05:15 +03:00
parent 649702eaca
commit c9624e7550
2 changed files with 8 additions and 1 deletions

View File

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

View File

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