Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

1.0.70 - Migrated to PluginUI (for server >= 4.8.0.10) #5

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,6 @@ AppPackages/
[Bb]in
[Oo]bj
sql
TestResults
[Tt]est[Rr]esult*
*.Cache
ClientBin
Expand All @@ -106,3 +105,4 @@ Generated_Code #added for RIA/Silverlight projects
_UpgradeReport_Files/
Backup*/
UpgradeLog*.XML
/.vs/
33 changes: 33 additions & 0 deletions NfoMetadata/Configuration/ConfigurationExtensions.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
namespace NfoMetadata.Configuration
{
using MediaBrowser.Common.Configuration;

public static class ConfigurationExtensions
{
public static XbmcMetadataOptions GetNfoConfiguration(this IConfigurationManager manager)
{
return manager.GetConfiguration<XbmcMetadataOptions>(ConfigurationFactory.ConfigurationKey);
}

public static void SaveNfoConfiguration(this IConfigurationManager manager, XbmcMetadataOptions xmlOptions)
{
manager.SaveConfiguration(ConfigurationFactory.ConfigurationKey, xmlOptions);
}

public static void CopyTo(this XbmcMetadataOptions xmlOptions, NfoMetadataOptions options)
{
options.EnablePathSubstitution = xmlOptions.EnablePathSubstitution;
options.ReleaseDateFormat = xmlOptions.ReleaseDateFormat;
options.UserId = xmlOptions.UserId;
options.SaveImagePathsInNfo = xmlOptions.SaveImagePathsInNfo;
}

public static void CopyTo(this NfoMetadataOptions options, XbmcMetadataOptions xmlOptions)
{
xmlOptions.EnablePathSubstitution = options.EnablePathSubstitution;
xmlOptions.ReleaseDateFormat = options.ReleaseDateFormat;
xmlOptions.UserId = options.UserId;
xmlOptions.SaveImagePathsInNfo = options.SaveImagePathsInNfo;
}
}
}
23 changes: 23 additions & 0 deletions NfoMetadata/Configuration/ConfigurationFactory.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
namespace NfoMetadata.Configuration
{
using System.Collections.Generic;

using MediaBrowser.Common.Configuration;

public class ConfigurationFactory : IConfigurationFactory
{
public const string ConfigurationKey = @"xbmcmetadata";

public IEnumerable<ConfigurationStore> GetConfigurations()
{
return new[]
{
new ConfigurationStore
{
ConfigurationType = typeof(XbmcMetadataOptions),
Key = ConfigurationKey
}
};
}
}
}
60 changes: 60 additions & 0 deletions NfoMetadata/Configuration/NfoMetadataOptions.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
namespace NfoMetadata.Configuration
{
using System.Collections.Generic;
using System.ComponentModel;

using Emby.Web.GenericEdit;
using Emby.Web.GenericEdit.Common;

using MediaBrowser.Model.Attributes;
using MediaBrowser.Model.LocalizationAttributes;
using NfoMetadata.Properties;

public class NfoMetadataOptions : EditableOptionsBase
{
public NfoMetadataOptions()
{
this.DateFormatList = new List<EditorSelectOption>
{ new EditorSelectOption("yyyy-MM-dd", "yyyy-MM-dd") };

this.UserList = new List<EditorSelectOption>
{ new EditorSelectOption("", "") };
}

/// <summary>Gets the editor title.</summary>
/// <value>The editor title.</value>
public override string EditorTitle => "Nfo Metadata Settings";

/// <summary>Gets the editor description.</summary>
/// <value>The editor description.</value>
public override string EditorDescription => Resources.HeaderKodiMetadataHelp;

[Browsable(false)]
public List<EditorSelectOption> DateFormatList { get; set; }

[Browsable(false)]
public List<EditorSelectOption> UserList { get; set; }

[LocalizedDisplayName("LabelKodiMetadataUser", typeof(Resources))]
[LocalizedDescription("LabelKodiMetadataUserHelp", typeof(Resources))]
[SelectItemsSource(nameof(UserList))]
public string UserId { get; set; }

[LocalizedDisplayName("LabelKodiMetadataDateFormat", typeof(Resources))]
[LocalizedDescription("LabelKodiMetadataDateFormatHelp", typeof(Resources))]
[SelectItemsSource(nameof(DateFormatList))]
public string ReleaseDateFormat { get; set; } = @"yyyy-MM-dd";

[LocalizedDisplayName("LabelKodiMetadataSaveImagePaths", typeof(Resources))]
[LocalizedDescription("LabelKodiMetadataSaveImagePathsHelp", typeof(Resources))]
public bool SaveImagePathsInNfo { get; set; }

[LocalizedDisplayName("LabelKodiMetadataEnablePathSubstitution", typeof(Resources))]
[LocalizedDescription("LabelKodiMetadataEnablePathSubstitutionHelp", typeof(Resources))]
public bool EnablePathSubstitution { get; set; } = true;

[LocalizedDisplayName("LabelKodiMetadataEnableExtraThumbs", typeof(Resources))]
[LocalizedDescription("LabelKodiMetadataEnableExtraThumbsHelp", typeof(Resources))]
public bool EnableExtraThumbs { get; set; } = true;
}
}
29 changes: 0 additions & 29 deletions NfoMetadata/Configuration/NfoOptions.cs

This file was deleted.

47 changes: 0 additions & 47 deletions NfoMetadata/Configuration/nfo.html

This file was deleted.

73 changes: 0 additions & 73 deletions NfoMetadata/Configuration/nfo.js

This file was deleted.

Loading