diff options
Diffstat (limited to 'MediaBrowser.Server.Implementations')
5 files changed, 55 insertions, 8 deletions
diff --git a/MediaBrowser.Server.Implementations/Configuration/ServerConfigurationManager.cs b/MediaBrowser.Server.Implementations/Configuration/ServerConfigurationManager.cs index da38616821..ab79c6a1af 100644 --- a/MediaBrowser.Server.Implementations/Configuration/ServerConfigurationManager.cs +++ b/MediaBrowser.Server.Implementations/Configuration/ServerConfigurationManager.cs @@ -1,4 +1,5 @@ using MediaBrowser.Common.Configuration; +using MediaBrowser.Common.Events; using MediaBrowser.Common.Implementations.Configuration; using MediaBrowser.Controller; using MediaBrowser.Controller.Configuration; @@ -29,6 +30,8 @@ namespace MediaBrowser.Server.Implementations.Configuration UpdateMetadataPath(); } + public event EventHandler<GenericEventArgs<ServerConfiguration>> ConfigurationUpdating; + /// <summary> /// Gets the type of the configuration. /// </summary> @@ -73,8 +76,8 @@ namespace MediaBrowser.Server.Implementations.Configuration /// </summary> private void UpdateItemsByNamePath() { - ((ServerApplicationPaths) ApplicationPaths).ItemsByNamePath = string.IsNullOrEmpty(Configuration.ItemsByNamePath) ? - null : + ((ServerApplicationPaths)ApplicationPaths).ItemsByNamePath = string.IsNullOrEmpty(Configuration.ItemsByNamePath) ? + null : Configuration.ItemsByNamePath; } @@ -105,13 +108,15 @@ namespace MediaBrowser.Server.Implementations.Configuration /// <exception cref="System.IO.DirectoryNotFoundException"></exception> public override void ReplaceConfiguration(BaseApplicationConfiguration newConfiguration) { - var newConfig = (ServerConfiguration) newConfiguration; + var newConfig = (ServerConfiguration)newConfiguration; ValidateItemByNamePath(newConfig); ValidateTranscodingTempPath(newConfig); ValidatePathSubstitutions(newConfig); ValidateMetadataPath(newConfig); + EventHelper.FireEventIfNotNull(ConfigurationUpdating, this, new GenericEventArgs<ServerConfiguration> { Argument = newConfig }, Logger); + base.ReplaceConfiguration(newConfiguration); } diff --git a/MediaBrowser.Server.Implementations/Localization/JavaScript/javascript.json b/MediaBrowser.Server.Implementations/Localization/JavaScript/javascript.json index c464b2534b..52ddcd795f 100644 --- a/MediaBrowser.Server.Implementations/Localization/JavaScript/javascript.json +++ b/MediaBrowser.Server.Implementations/Localization/JavaScript/javascript.json @@ -17,8 +17,6 @@ "PasswordResetConfirmation": "Are you sure you wish to reset the password?", "PasswordSaved": "Password saved.", "PasswordMatchError": "Password and password confirmation must match.", - "OptionOff": "Off", - "OptionOn": "On", "OptionRelease": "Official Release", "OptionBeta": "Beta", "OptionDev": "Dev (Unstable)", diff --git a/MediaBrowser.Server.Implementations/Localization/Server/server.json b/MediaBrowser.Server.Implementations/Localization/Server/server.json index c2e29649fd..d011d45d06 100644 --- a/MediaBrowser.Server.Implementations/Localization/Server/server.json +++ b/MediaBrowser.Server.Implementations/Localization/Server/server.json @@ -147,10 +147,8 @@ "ScheduledTasksTitle": "Scheduled Tasks", "TabMyPlugins": "My Plugins", "TabCatalog": "Catalog", - "TabUpdates": "Updates", "PluginsTitle": "Plugins", "HeaderAutomaticUpdates": "Automatic Updates", - "HeaderUpdateLevel": "Update Level", "HeaderNowPlaying": "Now Playing", "HeaderLatestAlbums": "Latest Albums", "HeaderLatestSongs": "Latest Songs", @@ -706,5 +704,13 @@ "OptionEnableM2tsModeHelp": "Enable m2ts mode when encoding to mpegts.", "OptionEstimateContentLength": "Estimate content length when transcoding", "OptionReportByteRangeSeekingWhenTranscoding": "Report that the server supports byte seeking when transcoding", - "OptionReportByteRangeSeekingWhenTranscodingHelp": "This is required for some devices that don't time seek very well." + "OptionReportByteRangeSeekingWhenTranscodingHelp": "This is required for some devices that don't time seek very well.", + "HeaderSubtitleDownloadingHelp": "Media Browser can inspect your video files for missing subtitles, and download them using a subtitle provider such as OpenSubtitles.org.", + "HeaderDownloadSubtitlesFor": "Download subtitles for:", + "LabelRequireExternalSubtitles": "Download even if the video already contains graphical subtitles", + "LabelRequireExternalSubtitlesHelp": "Keeping text versions of subtitles will result in more efficient delivery to mobile clients.", + "TabSubtitles": "Subtitles", + "LabelOpenSubtitlesUsername": "Open Subtitles username:", + "LabelOpenSubtitlesPassword": "Open Subtitles password:", + "LabelAudioLanguagePreferenceHelp": "If empty, the default audio track will be selected, regardless of language." }
\ No newline at end of file diff --git a/MediaBrowser.Server.Implementations/MediaBrowser.Server.Implementations.csproj b/MediaBrowser.Server.Implementations/MediaBrowser.Server.Implementations.csproj index 3532ee3703..74b8bf2699 100644 --- a/MediaBrowser.Server.Implementations/MediaBrowser.Server.Implementations.csproj +++ b/MediaBrowser.Server.Implementations/MediaBrowser.Server.Implementations.csproj @@ -64,6 +64,7 @@ <Reference Include="System.Drawing" /> <Reference Include="Microsoft.CSharp" /> <Reference Include="System.Data" /> + <Reference Include="System.Security" /> <Reference Include="System.Web" /> <Reference Include="System.Xml" /> <Reference Include="MoreLinq"> @@ -201,6 +202,7 @@ <Compile Include="ScheduledTasks\ChapterImagesTask.cs" /> <Compile Include="ScheduledTasks\RefreshIntrosTask.cs" /> <Compile Include="ScheduledTasks\RefreshMediaLibraryTask.cs" /> + <Compile Include="Security\EncryptionManager.cs" /> <Compile Include="ServerApplicationPaths.cs" /> <Compile Include="ServerManager\ServerManager.cs" /> <Compile Include="ServerManager\WebSocketConnection.cs" /> diff --git a/MediaBrowser.Server.Implementations/Security/EncryptionManager.cs b/MediaBrowser.Server.Implementations/Security/EncryptionManager.cs new file mode 100644 index 0000000000..73a4e30048 --- /dev/null +++ b/MediaBrowser.Server.Implementations/Security/EncryptionManager.cs @@ -0,0 +1,36 @@ +using MediaBrowser.Controller.Security; +using System; +using System.Security.Cryptography; +using System.Text; + +namespace MediaBrowser.Server.Implementations.Security +{ + public class EncryptionManager : IEncryptionManager + { + /// <summary> + /// Encrypts the string. + /// </summary> + /// <param name="value">The value.</param> + /// <returns>System.String.</returns> + /// <exception cref="System.ArgumentNullException">value</exception> + public string EncryptString(string value) + { + if (value == null) throw new ArgumentNullException("value"); + + return Encoding.Default.GetString(ProtectedData.Protect(Encoding.Default.GetBytes(value), null, DataProtectionScope.LocalMachine)); + } + + /// <summary> + /// Decrypts the string. + /// </summary> + /// <param name="value">The value.</param> + /// <returns>System.String.</returns> + /// <exception cref="System.ArgumentNullException">value</exception> + public string DecryptString(string value) + { + if (value == null) throw new ArgumentNullException("value"); + + return Encoding.Default.GetString(ProtectedData.Unprotect(Encoding.Default.GetBytes(value), null, DataProtectionScope.LocalMachine)); + } + } +} |
