From aae72912eb48f8c48be0a6564fa91b85cd55aa5a Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Sun, 12 Jul 2015 15:33:00 -0400 Subject: [PATCH 1/9] update dto dictionary building --- MediaBrowser.Controller/Entities/BaseItem.cs | 21 +- .../Movies/MovieExternalIds.cs | 8 + .../Dto/DtoService.cs | 18 +- .../bower_components/iron-meta/.bower.json | 6 +- .../dashboard-ui/css/card.css | 4 + .../dashboard-ui/css/librarybrowser.css | 8 +- .../dashboard-ui/index.html | 2 +- .../dashboard-ui/itemdetails.html | 4 +- .../dashboard-ui/nowplaying.html | 2 +- .../dashboard-ui/photos.html | 50 +++- .../dashboard-ui/scripts/favorites.js | 52 +++- .../dashboard-ui/scripts/homeupcoming.js | 90 ++++++- .../dashboard-ui/scripts/indexpage.js | 14 +- .../dashboard-ui/scripts/librarybrowser.js | 50 ++-- .../dashboard-ui/scripts/photos.js | 247 ++++++------------ .../dashboard-ui/scripts/secondaryitems.js | 121 ++++----- .../dashboard-ui/scripts/site.js | 4 +- .../dashboard-ui/scripts/tvupcoming.js | 101 +++++-- .../dashboard-ui/tvupcoming.html | 2 +- SharedVersion.cs | 4 +- 20 files changed, 461 insertions(+), 347 deletions(-) diff --git a/MediaBrowser.Controller/Entities/BaseItem.cs b/MediaBrowser.Controller/Entities/BaseItem.cs index 41329608e4..abd6e42628 100644 --- a/MediaBrowser.Controller/Entities/BaseItem.cs +++ b/MediaBrowser.Controller/Entities/BaseItem.cs @@ -466,12 +466,29 @@ protected virtual string CreateSortName() public Guid ParentId { get; set; } + private Folder _parent; /// /// Gets or sets the parent. /// /// The parent. - [IgnoreDataMember] - public Folder Parent { get; set; } + public Folder Parent + { + get + { + if (_parent != null) + { + return _parent; + } + + if (ParentId != Guid.Empty) + { + return LibraryManager.GetItemById(ParentId) as Folder; + } + + return null; + } + set { _parent = value; } + } public void SetParent(Folder parent) { diff --git a/MediaBrowser.Providers/Movies/MovieExternalIds.cs b/MediaBrowser.Providers/Movies/MovieExternalIds.cs index 9c09d9d00c..c582447a9f 100644 --- a/MediaBrowser.Providers/Movies/MovieExternalIds.cs +++ b/MediaBrowser.Providers/Movies/MovieExternalIds.cs @@ -2,6 +2,7 @@ using MediaBrowser.Controller.Entities; using MediaBrowser.Controller.Entities.Movies; using MediaBrowser.Controller.Entities.TV; +using MediaBrowser.Controller.LiveTv; using MediaBrowser.Controller.Providers; using MediaBrowser.Model.Channels; using MediaBrowser.Model.Entities; @@ -34,6 +35,13 @@ public bool Supports(IHasProviderIds item) return true; } + // Supports images for tv movies + var tvProgram = item as LiveTvProgram; + if (tvProgram != null && tvProgram.IsMovie) + { + return true; + } + return item is Movie || item is MusicVideo; } } diff --git a/MediaBrowser.Server.Implementations/Dto/DtoService.cs b/MediaBrowser.Server.Implementations/Dto/DtoService.cs index bdc758d8e8..257e0feb1a 100644 --- a/MediaBrowser.Server.Implementations/Dto/DtoService.cs +++ b/MediaBrowser.Server.Implementations/Dto/DtoService.cs @@ -88,7 +88,7 @@ public BaseItemDto GetBaseItemDto(BaseItem item, List fields, User u public IEnumerable GetBaseItemDtos(IEnumerable 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(); @@ -120,11 +120,23 @@ public IEnumerable GetBaseItemDtos(IEnumerable items, Dto return list; } + private Dictionary GetSyncedItemProgressDictionary(IEnumerable items) + { + var dict = new Dictionary(); + + 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 @@ public BaseItemDto GetItemByNameDto(T item, DtoOptions options, List i.ItemId), user); + var dto = GetBaseItemDtoInternal(item, options, GetSyncedItemProgressDictionary(syncProgress), user); if (options.Fields.Contains(ItemFields.ItemCounts)) { diff --git a/MediaBrowser.WebDashboard/dashboard-ui/bower_components/iron-meta/.bower.json b/MediaBrowser.WebDashboard/dashboard-ui/bower_components/iron-meta/.bower.json index 8119ebcf41..9e650790be 100644 --- a/MediaBrowser.WebDashboard/dashboard-ui/bower_components/iron-meta/.bower.json +++ b/MediaBrowser.WebDashboard/dashboard-ui/bower_components/iron-meta/.bower.json @@ -25,14 +25,14 @@ "web-component-tester": "*", "webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0" }, - "homepage": "https://github.com/polymerelements/iron-meta", + "homepage": "https://github.com/PolymerElements/iron-meta", "_release": "1.0.3", "_resolution": { "type": "version", "tag": "v1.0.3", "commit": "91529259262b0d8f33fed44bc3fd47aedf35cb04" }, - "_source": "git://github.com/polymerelements/iron-meta.git", + "_source": "git://github.com/PolymerElements/iron-meta.git", "_target": "^1.0.0", - "_originalSource": "polymerelements/iron-meta" + "_originalSource": "PolymerElements/iron-meta" } \ No newline at end of file diff --git a/MediaBrowser.WebDashboard/dashboard-ui/css/card.css b/MediaBrowser.WebDashboard/dashboard-ui/css/card.css index 6889af7bfb..cb59563e46 100644 --- a/MediaBrowser.WebDashboard/dashboard-ui/css/card.css +++ b/MediaBrowser.WebDashboard/dashboard-ui/css/card.css @@ -106,6 +106,10 @@ margin-bottom: 24px; } +.hiddenScrollX .bottomPaddedCard .cardBox { + margin-bottom: 0; +} + .visualCardBox { -moz-border-radius: 2px; -webkit-border-radius: 2px; diff --git a/MediaBrowser.WebDashboard/dashboard-ui/css/librarybrowser.css b/MediaBrowser.WebDashboard/dashboard-ui/css/librarybrowser.css index 29c42836f9..227119edc5 100644 --- a/MediaBrowser.WebDashboard/dashboard-ui/css/librarybrowser.css +++ b/MediaBrowser.WebDashboard/dashboard-ui/css/librarybrowser.css @@ -72,8 +72,8 @@ } .pageWithAbsoluteTabs .pageTabContent { - padding-left: .5em !important; - padding-right: .5em !important; + padding-left: .3em !important; + padding-right: .3em !important; } } @@ -84,6 +84,8 @@ .listHeader { margin: .25em 0; padding-left: 2px; + line-height: 1.25em; + line-height: initial; } .listHeader + paper-button { @@ -1748,4 +1750,4 @@ paper-icon-button.listviewMenuButton { .detailsMenuOverview { max-height: 160px; } -} \ No newline at end of file +} diff --git a/MediaBrowser.WebDashboard/dashboard-ui/index.html b/MediaBrowser.WebDashboard/dashboard-ui/index.html index 010aca9abc..db6e570eae 100644 --- a/MediaBrowser.WebDashboard/dashboard-ui/index.html +++ b/MediaBrowser.WebDashboard/dashboard-ui/index.html @@ -57,7 +57,7 @@

-
+