1
0
mirror of https://github.com/Radarr/Radarr.git synced 2024-11-05 02:22:31 +01:00

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 @@ public override MetadataFileResult MovieMetadata(Movie movie, MovieFile movieFil
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 @@ public interface ITagRepository : IBasicRepository<Tag>
{
Tag GetByLabel(string label);
Tag FindByLabel(string label);
List<Tag> GetTags(HashSet<int> tagIds);
}
public class TagRepository : BasicRepository<Tag>, ITagRepository
@ -34,5 +36,10 @@ public Tag FindByLabel(string label)
{
return Query(x => x.Label == label).SingleOrDefault();
}
public List<Tag> GetTags(HashSet<int> tagIds)
{
return Query(t => tagIds.Contains(t.Id));
}
}
}