From 8ec8b463942d132a71fd319535c63d7205075e54 Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Mon, 30 Oct 2017 00:51:43 -0400 Subject: allow separate configuration of date format --- .../Localization/Core/en-US.json | 7 +--- .../Localization/Core/hu.json | 44 +++++++++++----------- 2 files changed, 23 insertions(+), 28 deletions(-) (limited to 'Emby.Server.Implementations/Localization') diff --git a/Emby.Server.Implementations/Localization/Core/en-US.json b/Emby.Server.Implementations/Localization/Core/en-US.json index 51bbf341f..9c58b4539 100644 --- a/Emby.Server.Implementations/Localization/Core/en-US.json +++ b/Emby.Server.Implementations/Localization/Core/en-US.json @@ -87,10 +87,5 @@ "User": "User", "System": "System", "Application": "Application", - "Plugin": "Plugin", - "LabelExit": "Exit", - "LabelVisitCommunity": "Visit Community", - "LabelBrowseLibrary": "Browse Library", - "LabelConfigureServer": "Configure Emby", - "LabelRestartServer": "Restart Server" + "Plugin": "Plugin" } \ No newline at end of file diff --git a/Emby.Server.Implementations/Localization/Core/hu.json b/Emby.Server.Implementations/Localization/Core/hu.json index 80160966f..39d0f8061 100644 --- a/Emby.Server.Implementations/Localization/Core/hu.json +++ b/Emby.Server.Implementations/Localization/Core/hu.json @@ -2,31 +2,31 @@ "Latest": "Leg\u00fajabb", "ValueSpecialEpisodeName": "Special - {0}", "Inherit": "Inherit", - "Books": "Books", - "Music": "Music", - "Games": "Games", - "Photos": "Photos", - "MixedContent": "Mixed content", - "MusicVideos": "Music videos", - "HomeVideos": "Home videos", - "Playlists": "Playlists", + "Books": "K\u00f6nyvek", + "Music": "Zene", + "Games": "J\u00e1t\u00e9kok", + "Photos": "F\u00e9nyk\u00e9pek", + "MixedContent": "Vegyes tartalom", + "MusicVideos": "Zenei Vide\u00f3k", + "HomeVideos": "H\u00e1zi vide\u00f3k", + "Playlists": "Lej\u00e1tsz\u00e1si list\u00e1k", "HeaderRecordingGroups": "Recording Groups", "HeaderContinueWatching": "Vet\u00edt\u00e9s(ek) folytat\u00e1sa", - "HeaderFavoriteArtists": "Favorite Artists", - "HeaderFavoriteSongs": "Favorite Songs", - "HeaderAlbumArtists": "Album Artists", - "HeaderFavoriteAlbums": "Favorite Albums", + "HeaderFavoriteArtists": "Kedvenc M\u0171v\u00e9szek", + "HeaderFavoriteSongs": "Kedvenc Dalok", + "HeaderAlbumArtists": "Album El\u0151ad\u00f3k", + "HeaderFavoriteAlbums": "Kedvenc Albumok", "HeaderFavoriteEpisodes": "Kedvenc Epiz\u00f3dok", "HeaderFavoriteShows": "Kedvenc M\u0171sorok", "HeaderNextUp": "K\u00f6vetkezik", - "Favorites": "Favorites", + "Favorites": "Kedvencek", "Collections": "Gy\u0171jtem\u00e9nyek", "Channels": "Csatorn\u00e1k", - "Movies": "Movies", - "Albums": "Albums", - "Artists": "Artists", - "Folders": "Folders", - "Songs": "Songs", + "Movies": "Filmek", + "Albums": "Albumok", + "Artists": "El\u0151ad\u00f3k", + "Folders": "K\u00f6nyvt\u00e1rak", + "Songs": "Dalok", "TvShows": "TV Shows", "Shows": "Shows", "Genres": "M\u0171fajok", @@ -38,15 +38,15 @@ "ScheduledTaskFailedWithName": "{0} failed", "LabelRunningTimeValue": "Running time: {0}", "ScheduledTaskStartedWithName": "{0} started", - "VersionNumber": "Version {0}", + "VersionNumber": "Verzi\u00f3 {0}", "PluginInstalledWithName": "{0} telep\u00edtve", "StartupEmbyServerIsLoading": "Emby Szerver bet\u00f6lt\u0151dik. K\u00e9rj\u00fck, pr\u00f3b\u00e1ld meg \u00fajra k\u00e9s\u0151bb.", - "PluginUpdatedWithName": "{0} was updated", + "PluginUpdatedWithName": "{0} friss\u00edtve", "PluginUninstalledWithName": "{0} elt\u00e1vol\u00edtva", "ItemAddedWithName": "{0} was added to the library", "ItemRemovedWithName": "{0} was removed from the library", - "LabelIpAddressValue": "Ip address: {0}", - "DeviceOnlineWithName": "{0} is connected", + "LabelIpAddressValue": "Ip c\u00edm: {0}", + "DeviceOnlineWithName": "{0} bel\u00e9pett", "UserOnlineFromDevice": "{0} is online from {1}", "ProviderValue": "Provider: {0}", "SubtitlesDownloadedForItem": "Subtitles downloaded for {0}", -- cgit v1.2.3 From 0a0303ca64e346f0e939f1fe275334f752728c15 Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Wed, 1 Nov 2017 15:50:16 -0400 Subject: normalize strm file contents --- .../Configuration/ServerConfigurationManager.cs | 67 +++++++++++----------- .../Data/SqliteItemRepository.cs | 3 +- .../Library/LibraryManager.cs | 2 +- .../Localization/LocalizationManager.cs | 13 +++++ MediaBrowser.Api/ConfigurationService.cs | 2 - MediaBrowser.Api/StartupWizardService.cs | 12 +--- .../Configuration/IServerConfigurationManager.cs | 6 +- .../Configuration/ServerConfiguration.cs | 3 + MediaBrowser.Model/Dlna/PlaybackException.cs | 9 --- .../Globalization/ILocalizationManager.cs | 3 + MediaBrowser.Model/MediaBrowser.Model.csproj | 1 - .../MediaInfo/FFProbeProvider.cs | 6 +- 12 files changed, 64 insertions(+), 63 deletions(-) delete mode 100644 MediaBrowser.Model/Dlna/PlaybackException.cs (limited to 'Emby.Server.Implementations/Localization') diff --git a/Emby.Server.Implementations/Configuration/ServerConfigurationManager.cs b/Emby.Server.Implementations/Configuration/ServerConfigurationManager.cs index 4d9bf0624..607e896b8 100644 --- a/Emby.Server.Implementations/Configuration/ServerConfigurationManager.cs +++ b/Emby.Server.Implementations/Configuration/ServerConfigurationManager.cs @@ -195,52 +195,55 @@ namespace Emby.Server.Implementations.Configuration } } - public void DisableMetadataService(string service) + public bool SetOptimalValues() { - DisableMetadataService(typeof(Movie), Configuration, service); - DisableMetadataService(typeof(Episode), Configuration, service); - DisableMetadataService(typeof(Series), Configuration, service); - DisableMetadataService(typeof(Season), Configuration, service); - DisableMetadataService(typeof(MusicArtist), Configuration, service); - DisableMetadataService(typeof(MusicAlbum), Configuration, service); - DisableMetadataService(typeof(MusicVideo), Configuration, service); - DisableMetadataService(typeof(Video), Configuration, service); - } + var config = Configuration; - private void DisableMetadataService(Type type, ServerConfiguration config, string service) - { - var options = GetMetadataOptions(type, config); + var changed = false; - if (!options.DisabledMetadataSavers.Contains(service, StringComparer.OrdinalIgnoreCase)) + if (!config.EnableCaseSensitiveItemIds) { - var list = options.DisabledMetadataSavers.ToList(); - - list.Add(service); + config.EnableCaseSensitiveItemIds = true; + changed = true; + } - options.DisabledMetadataSavers = list.ToArray(list.Count); + if (!config.SkipDeserializationForBasicTypes) + { + config.SkipDeserializationForBasicTypes = true; + changed = true; } - } - private MetadataOptions GetMetadataOptions(Type type, ServerConfiguration config) - { - var options = config.MetadataOptions - .FirstOrDefault(i => string.Equals(i.ItemType, type.Name, StringComparison.OrdinalIgnoreCase)); + if (!config.EnableSimpleArtistDetection) + { + config.EnableSimpleArtistDetection = true; + changed = true; + } - if (options == null) + if (!config.EnableNormalizedItemByNameIds) { - var list = config.MetadataOptions.ToList(); + config.EnableNormalizedItemByNameIds = true; + changed = true; + } - options = new MetadataOptions - { - ItemType = type.Name - }; + if (!config.DisableLiveTvChannelUserDataName) + { + config.DisableLiveTvChannelUserDataName = true; + changed = true; + } - list.Add(options); + if (!config.EnableNewOmdbSupport) + { + config.EnableNewOmdbSupport = true; + changed = true; + } - config.MetadataOptions = list.ToArray(list.Count); + if (!config.EnableLocalizedGuids) + { + config.EnableLocalizedGuids = true; + changed = true; } - return options; + return changed; } } } diff --git a/Emby.Server.Implementations/Data/SqliteItemRepository.cs b/Emby.Server.Implementations/Data/SqliteItemRepository.cs index 01416a307..eb0f5150f 100644 --- a/Emby.Server.Implementations/Data/SqliteItemRepository.cs +++ b/Emby.Server.Implementations/Data/SqliteItemRepository.cs @@ -5298,7 +5298,8 @@ where AncestorIdText not null and ItemValues.Value not null and ItemValues.Type OfficialRatings = query.OfficialRatings, GenreIds = query.GenreIds, Genres = query.Genres, - Years = query.Years + Years = query.Years, + NameContains = query.NameContains }; var outerWhereClauses = GetWhereClauses(outerQuery, null); diff --git a/Emby.Server.Implementations/Library/LibraryManager.cs b/Emby.Server.Implementations/Library/LibraryManager.cs index bd8a09550..cac1cb3b4 100644 --- a/Emby.Server.Implementations/Library/LibraryManager.cs +++ b/Emby.Server.Implementations/Library/LibraryManager.cs @@ -506,7 +506,7 @@ namespace Emby.Server.Implementations.Library throw new ArgumentNullException("type"); } - if (key.StartsWith(ConfigurationManager.ApplicationPaths.ProgramDataPath)) + if (ConfigurationManager.Configuration.EnableLocalizedGuids && key.StartsWith(ConfigurationManager.ApplicationPaths.ProgramDataPath)) { // Try to normalize paths located underneath program-data in an attempt to make them more portable key = key.Substring(ConfigurationManager.ApplicationPaths.ProgramDataPath.Length) diff --git a/Emby.Server.Implementations/Localization/LocalizationManager.cs b/Emby.Server.Implementations/Localization/LocalizationManager.cs index 650f388a1..2eb4743cd 100644 --- a/Emby.Server.Implementations/Localization/LocalizationManager.cs +++ b/Emby.Server.Implementations/Localization/LocalizationManager.cs @@ -308,6 +308,19 @@ namespace Emby.Server.Implementations.Localization return value == null ? (int?)null : value.Value; } + public bool HasUnicodeCategory(string value, UnicodeCategory category) + { + foreach (var chr in value) + { + if (char.GetUnicodeCategory(chr) == category) + { + return true; + } + } + + return false; + } + public string GetLocalizedString(string phrase) { return GetLocalizedString(phrase, _configurationManager.Configuration.UICulture); diff --git a/MediaBrowser.Api/ConfigurationService.cs b/MediaBrowser.Api/ConfigurationService.cs index 643ecd9c8..0023c13d7 100644 --- a/MediaBrowser.Api/ConfigurationService.cs +++ b/MediaBrowser.Api/ConfigurationService.cs @@ -134,8 +134,6 @@ namespace MediaBrowser.Api public void Post(AutoSetMetadataOptions request) { - _configurationManager.DisableMetadataService("Emby Xml"); - _configurationManager.SaveConfiguration(); } /// diff --git a/MediaBrowser.Api/StartupWizardService.cs b/MediaBrowser.Api/StartupWizardService.cs index 1ccb68320..1b185b073 100644 --- a/MediaBrowser.Api/StartupWizardService.cs +++ b/MediaBrowser.Api/StartupWizardService.cs @@ -63,7 +63,7 @@ namespace MediaBrowser.Api public void Post(ReportStartupWizardComplete request) { _config.Configuration.IsStartupWizardCompleted = true; - SetWizardFinishValues(_config.Configuration); + _config.SetOptimalValues(); _config.SaveConfiguration(); } @@ -87,16 +87,6 @@ namespace MediaBrowser.Api return result; } - private void SetWizardFinishValues(ServerConfiguration config) - { - config.EnableCaseSensitiveItemIds = true; - config.SkipDeserializationForBasicTypes = true; - config.EnableSimpleArtistDetection = true; - config.EnableNormalizedItemByNameIds = true; - config.DisableLiveTvChannelUserDataName = true; - config.EnableNewOmdbSupport = true; - } - public void Post(UpdateStartupConfiguration request) { _config.Configuration.UICulture = request.UICulture; diff --git a/MediaBrowser.Controller/Configuration/IServerConfigurationManager.cs b/MediaBrowser.Controller/Configuration/IServerConfigurationManager.cs index 13c9f8d84..af5714932 100644 --- a/MediaBrowser.Controller/Configuration/IServerConfigurationManager.cs +++ b/MediaBrowser.Controller/Configuration/IServerConfigurationManager.cs @@ -20,10 +20,6 @@ namespace MediaBrowser.Controller.Configuration /// The configuration. ServerConfiguration Configuration { get; } - /// - /// Sets the preferred metadata service. - /// - /// The service. - void DisableMetadataService(string service); + bool SetOptimalValues(); } } diff --git a/MediaBrowser.Model/Configuration/ServerConfiguration.cs b/MediaBrowser.Model/Configuration/ServerConfiguration.cs index f2c3b7cc8..9b800bbc9 100644 --- a/MediaBrowser.Model/Configuration/ServerConfiguration.cs +++ b/MediaBrowser.Model/Configuration/ServerConfiguration.cs @@ -189,6 +189,8 @@ namespace MediaBrowser.Model.Configuration public PathSubstitution[] PathSubstitutions { get; set; } public bool EnableSimpleArtistDetection { get; set; } + public bool EnableLocalizedGuids { get; set; } + /// /// Initializes a new instance of the class. /// @@ -200,6 +202,7 @@ namespace MediaBrowser.Model.Configuration PathSubstitutions = new PathSubstitution[] { }; EnableSimpleArtistDetection = true; + EnableLocalizedGuids = true; DisplaySpecialsWithinSeasons = true; EnableExternalContentInSuggestions = true; diff --git a/MediaBrowser.Model/Dlna/PlaybackException.cs b/MediaBrowser.Model/Dlna/PlaybackException.cs deleted file mode 100644 index 761fa1c90..000000000 --- a/MediaBrowser.Model/Dlna/PlaybackException.cs +++ /dev/null @@ -1,9 +0,0 @@ -using System; - -namespace MediaBrowser.Model.Dlna -{ - public class PlaybackException : Exception - { - public PlaybackErrorCode ErrorCode { get; set;} - } -} diff --git a/MediaBrowser.Model/Globalization/ILocalizationManager.cs b/MediaBrowser.Model/Globalization/ILocalizationManager.cs index 2356a2fa1..61f0ebfd3 100644 --- a/MediaBrowser.Model/Globalization/ILocalizationManager.cs +++ b/MediaBrowser.Model/Globalization/ILocalizationManager.cs @@ -1,5 +1,6 @@ using System.Collections.Generic; using MediaBrowser.Model.Entities; +using System.Globalization; namespace MediaBrowser.Model.Globalization { @@ -54,5 +55,7 @@ namespace MediaBrowser.Model.Globalization string RemoveDiacritics(string text); string NormalizeFormKD(string text); + + bool HasUnicodeCategory(string value, UnicodeCategory category); } } diff --git a/MediaBrowser.Model/MediaBrowser.Model.csproj b/MediaBrowser.Model/MediaBrowser.Model.csproj index b36a773eb..dd9b7ff75 100644 --- a/MediaBrowser.Model/MediaBrowser.Model.csproj +++ b/MediaBrowser.Model/MediaBrowser.Model.csproj @@ -98,7 +98,6 @@ - diff --git a/MediaBrowser.Providers/MediaInfo/FFProbeProvider.cs b/MediaBrowser.Providers/MediaInfo/FFProbeProvider.cs index bce421901..e79aec33c 100644 --- a/MediaBrowser.Providers/MediaInfo/FFProbeProvider.cs +++ b/MediaBrowser.Providers/MediaInfo/FFProbeProvider.cs @@ -163,7 +163,11 @@ namespace MediaBrowser.Providers.MediaInfo private void FetchShortcutInfo(Video video) { - video.ShortcutPath = _fileSystem.ReadAllText(video.Path); + video.ShortcutPath = _fileSystem.ReadAllText(video.Path) + .Replace("\t", string.Empty) + .Replace("\r", string.Empty) + .Replace("\n", string.Empty) + .Trim(); } public Task FetchAudioInfo(T item, CancellationToken cancellationToken) -- cgit v1.2.3