New: Add tags to Kodi metadata
This commit is contained in:
parent
400838c79a
commit
d52b63e5e9
|
@ -13,6 +13,7 @@ using NzbDrone.Core.Extras.Metadata.Files;
|
|||
using NzbDrone.Core.MediaCover;
|
||||
using NzbDrone.Core.MediaFiles;
|
||||
using NzbDrone.Core.MediaFiles.MediaInfo;
|
||||
using NzbDrone.Core.Tags;
|
||||
using NzbDrone.Core.Tv;
|
||||
|
||||
namespace NzbDrone.Core.Extras.Metadata.Consumers.Xbmc
|
||||
|
@ -21,16 +22,19 @@ namespace NzbDrone.Core.Extras.Metadata.Consumers.Xbmc
|
|||
{
|
||||
private readonly Logger _logger;
|
||||
private readonly IMapCoversToLocal _mediaCoverService;
|
||||
private readonly ITagService _tagService;
|
||||
private readonly IDetectXbmcNfo _detectNfo;
|
||||
private readonly IDiskProvider _diskProvider;
|
||||
|
||||
public XbmcMetadata(IDetectXbmcNfo detectNfo,
|
||||
IDiskProvider diskProvider,
|
||||
IMapCoversToLocal mediaCoverService,
|
||||
ITagService tagService,
|
||||
Logger logger)
|
||||
{
|
||||
_logger = logger;
|
||||
_mediaCoverService = mediaCoverService;
|
||||
_tagService = tagService;
|
||||
_diskProvider = diskProvider;
|
||||
_detectNfo = detectNfo;
|
||||
}
|
||||
|
@ -180,6 +184,16 @@ namespace NzbDrone.Core.Extras.Metadata.Consumers.Xbmc
|
|||
tvShow.Add(new XElement("genre", genre));
|
||||
}
|
||||
|
||||
if (series.Tags.Any())
|
||||
{
|
||||
var tags = _tagService.GetTags(series.Tags);
|
||||
|
||||
foreach (var tag in tags)
|
||||
{
|
||||
tvShow.Add(new XElement("tag", tag.Label));
|
||||
}
|
||||
}
|
||||
|
||||
if (series.FirstAired.HasValue)
|
||||
{
|
||||
tvShow.Add(new XElement("premiered", series.FirstAired.Value.ToString("yyyy-MM-dd")));
|
||||
|
|
|
@ -12,6 +12,7 @@ namespace NzbDrone.Core.Tags
|
|||
{
|
||||
Tag GetTag(int tagId);
|
||||
Tag GetTag(string tag);
|
||||
List<Tag> GetTags(IEnumerable<int> ids);
|
||||
TagDetails Details(int tagId);
|
||||
List<TagDetails> Details();
|
||||
List<Tag> All();
|
||||
|
@ -61,6 +62,11 @@ namespace NzbDrone.Core.Tags
|
|||
}
|
||||
}
|
||||
|
||||
public List<Tag> GetTags(IEnumerable<int> ids)
|
||||
{
|
||||
return _repo.Get(ids).ToList();
|
||||
}
|
||||
|
||||
public TagDetails Details(int tagId)
|
||||
{
|
||||
var tag = GetTag(tagId);
|
||||
|
|
Loading…
Reference in New Issue