diff options
| author | Luke <luke.pulverenti@gmail.com> | 2017-11-02 12:07:40 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2017-11-02 12:07:40 -0400 |
| commit | 008cea6984d4e4bbdfb0b893e4cf0b6c59cb9d69 (patch) | |
| tree | 07bec24571b18a736bafc7ac7ee0b1eab9be72ba /Emby.Server.Implementations | |
| parent | 589300a3b004854457faab8a04fc86da5fffbac1 (diff) | |
| parent | de9292f117e507387287c3356ba73da788b13d75 (diff) | |
Merge pull request #2998 from MediaBrowser/beta
Beta
Diffstat (limited to 'Emby.Server.Implementations')
11 files changed, 120 insertions, 76 deletions
diff --git a/Emby.Server.Implementations/Configuration/ServerConfigurationManager.cs b/Emby.Server.Implementations/Configuration/ServerConfigurationManager.cs index 4d9bf0624..e73a69892 100644 --- a/Emby.Server.Implementations/Configuration/ServerConfigurationManager.cs +++ b/Emby.Server.Implementations/Configuration/ServerConfigurationManager.cs @@ -195,52 +195,49 @@ 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); - - options.DisabledMetadataSavers = list.ToArray(list.Count); + config.EnableCaseSensitiveItemIds = 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.SkipDeserializationForBasicTypes) + { + config.SkipDeserializationForBasicTypes = true; + changed = true; + } - if (options == null) + if (!config.EnableSimpleArtistDetection) { - var list = config.MetadataOptions.ToList(); + config.EnableSimpleArtistDetection = true; + changed = true; + } - options = new MetadataOptions - { - ItemType = type.Name - }; + if (!config.EnableNormalizedItemByNameIds) + { + config.EnableNormalizedItemByNameIds = true; + changed = true; + } - list.Add(options); + if (!config.DisableLiveTvChannelUserDataName) + { + config.DisableLiveTvChannelUserDataName = true; + changed = true; + } - config.MetadataOptions = list.ToArray(list.Count); + if (!config.EnableNewOmdbSupport) + { + config.EnableNewOmdbSupport = 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/Emby.Server.Implementations.csproj b/Emby.Server.Implementations/Emby.Server.Implementations.csproj index 1ecbabf2f..8ff1b63c0 100644 --- a/Emby.Server.Implementations/Emby.Server.Implementations.csproj +++ b/Emby.Server.Implementations/Emby.Server.Implementations.csproj @@ -651,8 +651,8 @@ <Reference Include="SharpCompress, Version=0.18.2.0, Culture=neutral, PublicKeyToken=afb0a02973931d96, processorArchitecture=MSIL"> <HintPath>..\packages\SharpCompress.0.18.2\lib\net45\SharpCompress.dll</HintPath> </Reference> - <Reference Include="SimpleInjector, Version=4.0.8.0, Culture=neutral, PublicKeyToken=984cb50dea722e99, processorArchitecture=MSIL"> - <HintPath>..\packages\SimpleInjector.4.0.8\lib\net45\SimpleInjector.dll</HintPath> + <Reference Include="SimpleInjector, Version=4.0.12.0, Culture=neutral, PublicKeyToken=984cb50dea722e99, processorArchitecture=MSIL"> + <HintPath>..\packages\SimpleInjector.4.0.12\lib\net45\SimpleInjector.dll</HintPath> </Reference> <Reference Include="SQLitePCL.pretty, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL"> <HintPath>..\packages\SQLitePCL.pretty.1.1.0\lib\portable-net45+netcore45+wpa81+wp8\SQLitePCL.pretty.dll</HintPath> diff --git a/Emby.Server.Implementations/Library/Resolvers/Movies/MovieResolver.cs b/Emby.Server.Implementations/Library/Resolvers/Movies/MovieResolver.cs index 94cafa3e2..d69a2b240 100644 --- a/Emby.Server.Implementations/Library/Resolvers/Movies/MovieResolver.cs +++ b/Emby.Server.Implementations/Library/Resolvers/Movies/MovieResolver.cs @@ -160,7 +160,7 @@ namespace Emby.Server.Implementations.Library.Resolvers.Movies ProductionYear = video.Year, Name = parseName ? video.Name : - Path.GetFileName(video.Files[0].Path), + Path.GetFileNameWithoutExtension(video.Files[0].Path), AdditionalParts = video.Files.Skip(1).Select(i => i.Path).ToArray(), LocalAlternateVersions = video.AlternateVersions.Select(i => i.Path).ToArray() }; diff --git a/Emby.Server.Implementations/Library/SearchEngine.cs b/Emby.Server.Implementations/Library/SearchEngine.cs index b1ed034ca..df21c1409 100644 --- a/Emby.Server.Implementations/Library/SearchEngine.cs +++ b/Emby.Server.Implementations/Library/SearchEngine.cs @@ -99,8 +99,6 @@ namespace Emby.Server.Implementations.Library var terms = GetWords(searchTerm); - var hints = new List<Tuple<BaseItem, string, int>>(); - var excludeItemTypes = query.ExcludeItemTypes.ToList(); var includeItemTypes = (query.IncludeItemTypes ?? new string[] { }).ToList(); @@ -161,8 +159,15 @@ namespace Emby.Server.Implementations.Library AddIfMissing(excludeItemTypes, typeof(CollectionFolder).Name); AddIfMissing(excludeItemTypes, typeof(Folder).Name); + var mediaTypes = query.MediaTypes.ToList(); + + if (includeItemTypes.Count > 0) + { + excludeItemTypes.Clear(); + mediaTypes.Clear(); + } - var mediaItems = _libraryManager.GetItemList(new InternalItemsQuery(user) + var searchQuery = new InternalItemsQuery(user) { NameContains = searchTerm, ExcludeItemTypes = excludeItemTypes.ToArray(excludeItemTypes.Count), @@ -178,7 +183,7 @@ namespace Emby.Server.Implementations.Library IsNews = query.IsNews, IsSeries = query.IsSeries, IsSports = query.IsSports, - MediaTypes = query.MediaTypes, + MediaTypes = mediaTypes.ToArray(), DtoOptions = new DtoOptions { @@ -189,17 +194,33 @@ namespace Emby.Server.Implementations.Library ItemFields.ChannelInfo } } - }); + }; + + List<BaseItem> mediaItems; + + if (searchQuery.IncludeItemTypes.Length == 1 && string.Equals(searchQuery.IncludeItemTypes[0], "MusicArtist", StringComparison.OrdinalIgnoreCase)) + { + if (searchQuery.ParentId.HasValue) + { + searchQuery.AncestorIds = new string[] { searchQuery.ParentId.Value.ToString("N") }; + } + searchQuery.ParentId = null; + searchQuery.IncludeItemsByName = true; + searchQuery.IncludeItemTypes = new string[] { }; + mediaItems = _libraryManager.GetArtists(searchQuery).Items.Select(i => i.Item1).ToList(); + } + else + { + mediaItems = _libraryManager.GetItemList(searchQuery); + } - // Add search hints based on item name - hints.AddRange(mediaItems.Select(item => + var returnValue = mediaItems.Select(item => { var index = GetIndex(item.Name, searchTerm, terms); return new Tuple<BaseItem, string, int>(item, index.Item1, index.Item2); - })); - var returnValue = hints.Where(i => i.Item3 >= 0).OrderBy(i => i.Item3).ThenBy(i => i.Item1.SortName).Select(i => new SearchHintInfo + }).OrderBy(i => i.Item3).ThenBy(i => i.Item1.SortName).Select(i => new SearchHintInfo { Item = i.Item1, MatchedTerm = i.Item2 diff --git a/Emby.Server.Implementations/LiveTv/TunerHosts/LiveStream.cs b/Emby.Server.Implementations/LiveTv/TunerHosts/LiveStream.cs index 12695cd8e..862098735 100644 --- a/Emby.Server.Implementations/LiveTv/TunerHosts/LiveStream.cs +++ b/Emby.Server.Implementations/LiveTv/TunerHosts/LiveStream.cs @@ -44,7 +44,7 @@ namespace Emby.Server.Implementations.LiveTv.TunerHosts EnableStreamSharing = true; SharedStreamIds = new List<string>(); UniqueId = Guid.NewGuid().ToString("N"); - TempFilePath = Path.Combine(appPaths.TranscodingTempPath, UniqueId + ".ts"); + TempFilePath = Path.Combine(appPaths.GetTranscodingTempPath(), UniqueId + ".ts"); } public virtual Task Open(CancellationToken openCancellationToken) 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}", 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/Emby.Server.Implementations/ServerApplicationPaths.cs b/Emby.Server.Implementations/ServerApplicationPaths.cs index 675b0d78c..3e3f7e0d7 100644 --- a/Emby.Server.Implementations/ServerApplicationPaths.cs +++ b/Emby.Server.Implementations/ServerApplicationPaths.cs @@ -206,6 +206,23 @@ namespace Emby.Server.Implementations } } + public string GetTranscodingTempPath() + { + var path = TranscodingTempPath; + + try + { + Directory.CreateDirectory(path); + return path; + } + catch + { + path = Path.Combine(ProgramDataPath, "transcoding-temp"); + Directory.CreateDirectory(path); + return path; + } + } + /// <summary> /// Gets the game genre path. /// </summary> diff --git a/Emby.Server.Implementations/packages.config b/Emby.Server.Implementations/packages.config index d27722fef..6e68810d8 100644 --- a/Emby.Server.Implementations/packages.config +++ b/Emby.Server.Implementations/packages.config @@ -3,7 +3,7 @@ <package id="Emby.XmlTv" version="1.0.10" targetFramework="net46" /> <package id="ServiceStack.Text" version="4.5.8" targetFramework="net46" /> <package id="SharpCompress" version="0.18.2" targetFramework="net46" /> - <package id="SimpleInjector" version="4.0.8" targetFramework="net46" /> + <package id="SimpleInjector" version="4.0.12" targetFramework="net46" /> <package id="SQLitePCL.pretty" version="1.1.0" targetFramework="portable45-net45+win8" /> <package id="SQLitePCLRaw.core" version="1.1.8" targetFramework="net46" /> </packages>
\ No newline at end of file |
