diff options
| author | Luke <luke.pulverenti@gmail.com> | 2015-07-16 09:00:03 -0400 |
|---|---|---|
| committer | Luke <luke.pulverenti@gmail.com> | 2015-07-16 09:00:03 -0400 |
| commit | 087b9c6fd2bfbbd10a4fcbfe335550beb9085a04 (patch) | |
| tree | c474f1d70d4cdbc513034dc3832e4d266719ddea /MediaBrowser.Server.Implementations | |
| parent | 2022c5631fe18996b23330a58133cb18d1e9600e (diff) | |
| parent | c6a64efab781269f9dc512282f27f2a2d3fdb1f2 (diff) | |
Merge pull request #1140 from MediaBrowser/dev
3.0.5675.1
Diffstat (limited to 'MediaBrowser.Server.Implementations')
9 files changed, 68 insertions, 21 deletions
diff --git a/MediaBrowser.Server.Implementations/Dto/DtoService.cs b/MediaBrowser.Server.Implementations/Dto/DtoService.cs index bdc758d8e..257e0feb1 100644 --- a/MediaBrowser.Server.Implementations/Dto/DtoService.cs +++ b/MediaBrowser.Server.Implementations/Dto/DtoService.cs @@ -88,7 +88,7 @@ namespace MediaBrowser.Server.Implementations.Dto public IEnumerable<BaseItemDto> GetBaseItemDtos(IEnumerable<BaseItem> items, DtoOptions options, User user = null, BaseItem owner = null) { var syncJobItems = GetSyncedItemProgress(options); - var syncDictionary = syncJobItems.ToDictionary(i => i.ItemId); + var syncDictionary = GetSyncedItemProgressDictionary(syncJobItems); var list = new List<BaseItemDto>(); @@ -120,11 +120,23 @@ namespace MediaBrowser.Server.Implementations.Dto return list; } + private Dictionary<string, SyncedItemProgress> GetSyncedItemProgressDictionary(IEnumerable<SyncedItemProgress> items) + { + var dict = new Dictionary<string, SyncedItemProgress>(); + + foreach (var item in items) + { + dict[item.ItemId] = item; + } + + return dict; + } + public BaseItemDto GetBaseItemDto(BaseItem item, DtoOptions options, User user = null, BaseItem owner = null) { var syncProgress = GetSyncedItemProgress(options); - var dto = GetBaseItemDtoInternal(item, options, syncProgress.ToDictionary(i => i.ItemId), user, owner); + var dto = GetBaseItemDtoInternal(item, options, GetSyncedItemProgressDictionary(syncProgress), user, owner); var byName = item as IItemByName; @@ -382,7 +394,7 @@ namespace MediaBrowser.Server.Implementations.Dto { var syncProgress = GetSyncedItemProgress(options); - var dto = GetBaseItemDtoInternal(item, options, syncProgress.ToDictionary(i => i.ItemId), user); + var dto = GetBaseItemDtoInternal(item, options, GetSyncedItemProgressDictionary(syncProgress), user); if (options.Fields.Contains(ItemFields.ItemCounts)) { diff --git a/MediaBrowser.Server.Implementations/EntryPoints/Notifications/Notifications.cs b/MediaBrowser.Server.Implementations/EntryPoints/Notifications/Notifications.cs index 2fc249744..8d21d9a77 100644 --- a/MediaBrowser.Server.Implementations/EntryPoints/Notifications/Notifications.cs +++ b/MediaBrowser.Server.Implementations/EntryPoints/Notifications/Notifications.cs @@ -256,7 +256,15 @@ namespace MediaBrowser.Server.Implementations.EntryPoints.Notifications NotificationType = type }; - notification.Variables["ItemName"] = item.Name; + if (e.Item != null) + { + notification.Variables["ItemName"] = GetItemName(e.Item); + } + else + { + notification.Variables["ItemName"] = item.Name; + } + notification.Variables["UserName"] = user == null ? "Unknown user" : user.Name; notification.Variables["AppName"] = e.ClientName; notification.Variables["DeviceName"] = e.DeviceName; diff --git a/MediaBrowser.Server.Implementations/Library/LibraryManager.cs b/MediaBrowser.Server.Implementations/Library/LibraryManager.cs index c3793b3a3..bdc94b88b 100644 --- a/MediaBrowser.Server.Implementations/Library/LibraryManager.cs +++ b/MediaBrowser.Server.Implementations/Library/LibraryManager.cs @@ -345,7 +345,7 @@ namespace MediaBrowser.Server.Implementations.Library try { - await UpdateItem(season, ItemUpdateType.MetadataEdit, cancellationToken).ConfigureAwait(false); + await UpdateItem(season, ItemUpdateType.MetadataDownload, cancellationToken).ConfigureAwait(false); } catch (Exception ex) { @@ -2071,10 +2071,17 @@ namespace MediaBrowser.Server.Implementations.Library public List<PersonInfo> GetPeople(BaseItem item) { - return item.People ?? GetPeople(new InternalPeopleQuery + var people = GetPeople(new InternalPeopleQuery { ItemId = item.Id }); + + if (people.Count > 0) + { + return people; + } + + return item.People ?? new List<PersonInfo>(); } public List<Person> GetPeopleItems(InternalPeopleQuery query) @@ -2106,15 +2113,9 @@ namespace MediaBrowser.Server.Implementations.Library .ToList(); } - public async Task UpdatePeople(BaseItem item, List<PersonInfo> people) + public Task UpdatePeople(BaseItem item, List<PersonInfo> people) { - await ItemRepository.UpdatePeople(item.Id, people).ConfigureAwait(false); - - if (item.People != null) - { - item.People = null; - await item.UpdateToRepository(ItemUpdateType.MetadataEdit, CancellationToken.None).ConfigureAwait(false); - } + return ItemRepository.UpdatePeople(item.Id, people); } } } diff --git a/MediaBrowser.Server.Implementations/Library/Resolvers/BaseVideoResolver.cs b/MediaBrowser.Server.Implementations/Library/Resolvers/BaseVideoResolver.cs index 3333719b7..343b6d3a4 100644 --- a/MediaBrowser.Server.Implementations/Library/Resolvers/BaseVideoResolver.cs +++ b/MediaBrowser.Server.Implementations/Library/Resolvers/BaseVideoResolver.cs @@ -1,13 +1,10 @@ using MediaBrowser.Controller.Entities; using MediaBrowser.Controller.Library; -using MediaBrowser.Controller.Providers; using MediaBrowser.Model.Entities; -using MediaBrowser.Naming.Common; using MediaBrowser.Naming.Video; +using MediaBrowser.Server.Implementations.Logging; using System; using System.IO; -using System.Linq; -using MediaBrowser.Server.Implementations.Logging; namespace MediaBrowser.Server.Implementations.Library.Resolvers { diff --git a/MediaBrowser.Server.Implementations/Localization/JavaScript/javascript.json b/MediaBrowser.Server.Implementations/Localization/JavaScript/javascript.json index b82bd29a7..2d56e9656 100644 --- a/MediaBrowser.Server.Implementations/Localization/JavaScript/javascript.json +++ b/MediaBrowser.Server.Implementations/Localization/JavaScript/javascript.json @@ -815,5 +815,6 @@ "HeaderShare": "Share", "ButtonShareHelp": "Share a web page containing media information with social media. Media files are never shared publicly.", "ButtonShare": "Share", - "HeaderConfirm": "Confirm" + "HeaderConfirm": "Confirm", + "ButtonAdvancedRefresh": "Advanced Refresh" } diff --git a/MediaBrowser.Server.Implementations/Localization/Server/server.json b/MediaBrowser.Server.Implementations/Localization/Server/server.json index 55e754085..138c87712 100644 --- a/MediaBrowser.Server.Implementations/Localization/Server/server.json +++ b/MediaBrowser.Server.Implementations/Localization/Server/server.json @@ -86,7 +86,7 @@ "OptionDetectArchiveFilesAsMedia": "Detect archive files as media", "OptionDetectArchiveFilesAsMediaHelp": "If enabled, files with .rar and .zip extensions will be detected as media files.", "LabelEnterConnectUserName": "Username or email:", - "LabelEnterConnectUserNameHelp": "This is your Emby online account username or password.", + "LabelEnterConnectUserNameHelp": "This is your Emby online account username or email.", "LabelEnableEnhancedMovies": "Enable enhanced movie displays", "LabelEnableEnhancedMoviesHelp": "When enabled, movies will be displayed as folders to include trailers, extras, cast & crew, and other related content.", "HeaderSyncJobInfo": "Sync Job", @@ -1466,5 +1466,7 @@ "TabHomeScreen": "Home Screen", "HeaderDisplay": "Display", "HeaderNavigation": "Navigation", - "LegendTheseSettingsShared": "These settings are shared on all devices" + "LegendTheseSettingsShared": "These settings are shared on all devices", + "OptionEnableAutomaticServerUpdates": "Enable automatic server updates", + "OptionOtherTrailers": "Include trailers from older movies" } diff --git a/MediaBrowser.Server.Implementations/Sorting/NameComparer.cs b/MediaBrowser.Server.Implementations/Sorting/NameComparer.cs index 83b1b2d16..18fddb903 100644 --- a/MediaBrowser.Server.Implementations/Sorting/NameComparer.cs +++ b/MediaBrowser.Server.Implementations/Sorting/NameComparer.cs @@ -1,6 +1,7 @@ using MediaBrowser.Controller.Entities; using MediaBrowser.Controller.Sorting; using MediaBrowser.Model.Querying; +using System; namespace MediaBrowser.Server.Implementations.Sorting { @@ -17,6 +18,11 @@ namespace MediaBrowser.Server.Implementations.Sorting /// <returns>System.Int32.</returns> public int Compare(BaseItem x, BaseItem y) { + if (!x.EnableAlphaNumericSorting || !y.EnableAlphaNumericSorting) + { + return string.Compare(x.SortName, y.SortName, StringComparison.CurrentCultureIgnoreCase); + } + return AlphanumComparator.CompareValues(x.Name, y.Name); } diff --git a/MediaBrowser.Server.Implementations/Sorting/SortNameComparer.cs b/MediaBrowser.Server.Implementations/Sorting/SortNameComparer.cs index e635cfbe5..389b21ba7 100644 --- a/MediaBrowser.Server.Implementations/Sorting/SortNameComparer.cs +++ b/MediaBrowser.Server.Implementations/Sorting/SortNameComparer.cs @@ -1,6 +1,7 @@ using MediaBrowser.Controller.Entities; using MediaBrowser.Controller.Sorting; using MediaBrowser.Model.Querying; +using System; namespace MediaBrowser.Server.Implementations.Sorting { @@ -17,6 +18,11 @@ namespace MediaBrowser.Server.Implementations.Sorting /// <returns>System.Int32.</returns> public int Compare(BaseItem x, BaseItem y) { + if (!x.EnableAlphaNumericSorting || !y.EnableAlphaNumericSorting) + { + return string.Compare(x.SortName, y.SortName, StringComparison.CurrentCultureIgnoreCase); + } + return AlphanumComparator.CompareValues(x.SortName, y.SortName); } diff --git a/MediaBrowser.Server.Implementations/Sync/CloudSyncProfile.cs b/MediaBrowser.Server.Implementations/Sync/CloudSyncProfile.cs index 6272fe926..175dbbc01 100644 --- a/MediaBrowser.Server.Implementations/Sync/CloudSyncProfile.cs +++ b/MediaBrowser.Server.Implementations/Sync/CloudSyncProfile.cs @@ -210,6 +210,13 @@ namespace MediaBrowser.Server.Implementations.Sync }, new ProfileCondition { + Condition = ProfileConditionType.LessThanEqual, + Property = ProfileConditionValue.AudioBitrate, + Value = "320000", + IsRequired = true + }, + new ProfileCondition + { Condition = ProfileConditionType.Equals, Property = ProfileConditionValue.IsSecondaryAudio, Value = "false", @@ -232,6 +239,13 @@ namespace MediaBrowser.Server.Implementations.Sync }, new ProfileCondition { + Condition = ProfileConditionType.LessThanEqual, + Property = ProfileConditionValue.AudioBitrate, + Value = "320000", + IsRequired = true + }, + new ProfileCondition + { Condition = ProfileConditionType.Equals, Property = ProfileConditionValue.IsSecondaryAudio, Value = "false", |
