New: Add TVDB URL in Kodi metadata

pull/4606/head
Zippy79 4 years ago committed by GitHub
parent 4bf3ab1511
commit 155dbd4dd5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -15,6 +15,7 @@ import ProviderFieldFormGroup from 'Components/Form/ProviderFieldFormGroup';
function EditMetadataModalContent(props) { function EditMetadataModalContent(props) {
const { const {
advancedSettings,
isSaving, isSaving,
saveError, saveError,
item, item,
@ -56,6 +57,7 @@ function EditMetadataModalContent(props) {
return ( return (
<ProviderFieldFormGroup <ProviderFieldFormGroup
key={field.name} key={field.name}
advancedSettings={advancedSettings}
provider="metadata" provider="metadata"
{...field} {...field}
isDisabled={!enable.value} isDisabled={!enable.value}
@ -88,6 +90,7 @@ function EditMetadataModalContent(props) {
} }
EditMetadataModalContent.propTypes = { EditMetadataModalContent.propTypes = {
advancedSettings: PropTypes.bool.isRequired,
isSaving: PropTypes.bool.isRequired, isSaving: PropTypes.bool.isRequired,
saveError: PropTypes.object, saveError: PropTypes.object,
item: PropTypes.object.isRequired, item: PropTypes.object.isRequired,

@ -9,9 +9,10 @@ import EditMetadataModalContent from './EditMetadataModalContent';
function createMapStateToProps() { function createMapStateToProps() {
return createSelector( return createSelector(
(state) => state.settings.advancedSettings,
(state, { id }) => id, (state, { id }) => id,
(state) => state.settings.metadata, (state) => state.settings.metadata,
(id, metadata) => { (advancedSettings, id, metadata) => {
const { const {
isSaving, isSaving,
saveError, saveError,
@ -22,6 +23,7 @@ function createMapStateToProps() {
const settings = selectSettings(_.find(items, { id }), pendingChanges, saveError); const settings = selectSettings(_.find(items, { id }), pendingChanges, saveError);
return { return {
advancedSettings,
id, id,
isSaving, isSaving,
saveError, saveError,

@ -137,12 +137,11 @@ namespace NzbDrone.Core.Extras.Metadata.Consumers.Xbmc
public override MetadataFileResult SeriesMetadata(Series series) public override MetadataFileResult SeriesMetadata(Series series)
{ {
if (!Settings.SeriesMetadata) var xmlResult = string.Empty;
{
return null;
}
_logger.Debug("Generating tvshow.nfo for: {0}", series.Title); if (Settings.SeriesMetadata)
{
_logger.Debug("Generating Series Metadata for: {0}", series.Title);
var sb = new StringBuilder(); var sb = new StringBuilder();
var xws = new XmlWriterSettings(); var xws = new XmlWriterSettings();
xws.OmitXmlDeclaration = true; xws.OmitXmlDeclaration = true;
@ -214,10 +213,21 @@ namespace NzbDrone.Core.Extras.Metadata.Consumers.Xbmc
var doc = new XDocument(tvShow); var doc = new XDocument(tvShow);
doc.Save(xw); doc.Save(xw);
_logger.Debug("Saving tvshow.nfo for {0}", series.Title); xmlResult += doc.ToString();
}
}
if (Settings.SeriesMetadataUrl)
{
if (Settings.SeriesMetadata)
{
xmlResult += Environment.NewLine;
}
return new MetadataFileResult("tvshow.nfo", doc.ToString()); xmlResult += "https://www.thetvdb.com/?tab=series&id=" + series.TvdbId;
} }
return xmlResult == string.Empty ? null : new MetadataFileResult("tvshow.nfo", xmlResult);
} }
public override MetadataFileResult EpisodeMetadata(Series series, EpisodeFile episodeFile) public override MetadataFileResult EpisodeMetadata(Series series, EpisodeFile episodeFile)

@ -19,25 +19,29 @@ namespace NzbDrone.Core.Extras.Metadata.Consumers.Xbmc
public XbmcMetadataSettings() public XbmcMetadataSettings()
{ {
SeriesMetadata = true; SeriesMetadata = true;
SeriesMetadataUrl = false;
EpisodeMetadata = true; EpisodeMetadata = true;
SeriesImages = true; SeriesImages = true;
SeasonImages = true; SeasonImages = true;
EpisodeImages = true; EpisodeImages = true;
} }
[FieldDefinition(0, Label = "Series Metadata", Type = FieldType.Checkbox, Section = MetadataSectionType.Metadata, HelpText = "tvshow.nfo")] [FieldDefinition(0, Label = "Series Metadata", Type = FieldType.Checkbox, Section = MetadataSectionType.Metadata, HelpText = "tvshow.nfo with full series metadata")]
public bool SeriesMetadata { get; set; } public bool SeriesMetadata { get; set; }
[FieldDefinition(1, Label = "Episode Metadata", Type = FieldType.Checkbox, Section = MetadataSectionType.Metadata, HelpText = "<filename>.nfo")] [FieldDefinition(1, Label = "Series Metadata URL", Type = FieldType.Checkbox, Section = MetadataSectionType.Metadata, HelpText = "tvshow.nfo with TheTVDB show URL (can be combined with 'Series Metadata')", Advanced = true)]
public bool SeriesMetadataUrl { get; set; }
[FieldDefinition(2, Label = "Episode Metadata", Type = FieldType.Checkbox, Section = MetadataSectionType.Metadata, HelpText = "<filename>.nfo")]
public bool EpisodeMetadata { get; set; } public bool EpisodeMetadata { get; set; }
[FieldDefinition(2, Label = "Series Images", Type = FieldType.Checkbox, Section = MetadataSectionType.Image, HelpText = "fanart.jpg, poster.jpg, banner.jpg")] [FieldDefinition(3, Label = "Series Images", Type = FieldType.Checkbox, Section = MetadataSectionType.Image, HelpText = "fanart.jpg, poster.jpg, banner.jpg")]
public bool SeriesImages { get; set; } public bool SeriesImages { get; set; }
[FieldDefinition(3, Label = "Season Images", Type = FieldType.Checkbox, Section = MetadataSectionType.Image, HelpText = "season##-poster.jpg, season##-banner.jpg, season-specials-poster.jpg, season-specials-banner.jpg")] [FieldDefinition(4, Label = "Season Images", Type = FieldType.Checkbox, Section = MetadataSectionType.Image, HelpText = "season##-poster.jpg, season##-banner.jpg, season-specials-poster.jpg, season-specials-banner.jpg")]
public bool SeasonImages { get; set; } public bool SeasonImages { get; set; }
[FieldDefinition(4, Label = "Episode Images", Type = FieldType.Checkbox, Section = MetadataSectionType.Image, HelpText = "<filename>-thumb.jpg")] [FieldDefinition(5, Label = "Episode Images", Type = FieldType.Checkbox, Section = MetadataSectionType.Image, HelpText = "<filename>-thumb.jpg")]
public bool EpisodeImages { get; set; } public bool EpisodeImages { get; set; }
public bool IsValid => true; public bool IsValid => true;

Loading…
Cancel
Save