From 9d932e463a19ae08a04a3f862ebcec6865cdff1a Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Fri, 21 Feb 2014 13:48:15 -0500 Subject: [PATCH] make external id's modular --- dashboard-ui/css/metadataeditor.css | 42 +++++----- dashboard-ui/scripts/librarybrowser.js | 87 ++------------------- dashboard-ui/scripts/moviesrecommended.js | 6 +- dashboard-ui/scripts/musicrecommended.js | 8 +- dashboard-ui/scripts/tvrecommended.js | 2 +- dashboard-ui/scripts/userparentalcontrol.js | 4 +- dashboard-ui/userparentalcontrol.html | 1 - 7 files changed, 39 insertions(+), 111 deletions(-) diff --git a/dashboard-ui/css/metadataeditor.css b/dashboard-ui/css/metadataeditor.css index 503bff4c25..8daeaeda25 100644 --- a/dashboard-ui/css/metadataeditor.css +++ b/dashboard-ui/css/metadataeditor.css @@ -14,6 +14,10 @@ display: none; } +.libraryTree { + margin-left: .25em; +} + .offlineEditorNode { color: #cc3333; } @@ -94,23 +98,6 @@ height: 450px; } - .editPageSidebar { - position: fixed; - top: 48px; - bottom: 0; - left: 0; - width: 27.5%; - overflow-y: scroll; - overflow-x: auto!important; - display: block; - border-right: 1px solid #555; - } - - .editPageInnerContent { - float: right; - width: 70%; - } - .remoteBannerImage { width: 450px; height: 83px; @@ -159,6 +146,23 @@ .availableImagesList { width: 700px; } + + .editPageSidebar { + position: fixed; + top: 48px; + bottom: 0; + left: 0; + width: 30%; + overflow-y: scroll; + overflow-x: auto!important; + display: block; + border-right: 1px solid #555; + } + + .editPageInnerContent { + float: right; + width: 67.5%; + } } @media all and (min-width: 900px) { @@ -213,11 +217,11 @@ @media all and (min-width: 1800px) { .editPageSidebar { - width: 22.5%; + width: 25%; } .editPageInnerContent { - width: 75%; + width: 72.5%; } } diff --git a/dashboard-ui/scripts/librarybrowser.js b/dashboard-ui/scripts/librarybrowser.js index 854318d1a6..8c86a877e1 100644 --- a/dashboard-ui/scripts/librarybrowser.js +++ b/dashboard-ui/scripts/librarybrowser.js @@ -1333,90 +1333,15 @@ links.push('Website'); } - var providerIds = item.ProviderIds || {}; + if (item.ExternalUrls) { - if (providerIds.Imdb) { - if (item.Type == "Person") { - links.push('IMDb'); - } - else { - links.push('IMDb'); + for (var i = 0, length = item.ExternalUrls.length; i < length; i++) { + + var url = item.ExternalUrls[i]; + + links.push('' + url.Name + ''); } } - if (providerIds.Tmdb) { - if (item.Type == "Movie" || item.Type == "Trailer" || item.Type == "MusicVideo") - links.push('TheMovieDB'); - else if (item.Type == "BoxSet") - links.push('TheMovieDB'); - else if (item.Type == "Person") - links.push('TheMovieDB'); - else if (item.Type == "Series") - links.push('TheMovieDB'); - } - if (providerIds.Tvdb) { - - if (item.Type == "Series") { - links.push('TheTVDB'); - } - } - if (providerIds.Tvcom) { - if (item.Type == "Episode") - links.push('TV.com'); - else if (item.Type == "Person") - links.push('TV.com'); - } - if (providerIds.MusicBrainzAlbum) { - - links.push('MusicBrainz Album'); - - } - if (providerIds.MusicBrainzAlbumArtist) { - - links.push('MusicBrainz Album Artist'); - - } - if (providerIds.MusicBrainzArtist) { - - var text = item.Type == "MusicArtist" ? "MusicBrainz" : "MusicBrainz Artist"; - - links.push('' + text + ''); - - } - if (providerIds.MusicBrainzReleaseGroup) { - - links.push('MusicBrainz Release Group'); - - } - if (providerIds.AudioDbArtist) { - - if (item.Type == "MusicArtist") - links.push('TheAudioDB'); - else - links.push('TheAudioDB Artist'); - } - if (providerIds.AudioDbAlbum) { - - if (item.Type == "MusicAlbum") - links.push('TheAudioDB'); - else - links.push('TheAudioDB Album'); - } - if (providerIds.Gamesdb) { - links.push('GamesDB'); - } - - if (providerIds.NesBox) { - - if (item.GameSystem == "Nintendo") { - links.push('NESbox'); - } - else if (item.GameSystem == "Super Nintendo") { - links.push('SNESbox'); - } - } - - if (providerIds.Zap2It) - links.push('Zap2It'); if (links.length) { diff --git a/dashboard-ui/scripts/moviesrecommended.js b/dashboard-ui/scripts/moviesrecommended.js index 5d42ad64af..8fa0616503 100644 --- a/dashboard-ui/scripts/moviesrecommended.js +++ b/dashboard-ui/scripts/moviesrecommended.js @@ -11,7 +11,7 @@ SortBy: "DateCreated", SortOrder: "Descending", IncludeItemTypes: "Movie", - Limit: screenWidth >= 1440 ? 16 : 12, + Limit: screenWidth >= 1440 ? 21 : 12, Recursive: true, Fields: "PrimaryImageAspectRatio,DateCreated,UserData", Filters: "IsUnplayed" @@ -33,7 +33,7 @@ SortOrder: "Descending", IncludeItemTypes: "Movie", Filters: "IsResumable", - Limit: screenWidth >= 1920 ? 5 : (screenWidth >= 1440 ? 4 : 3), + Limit: screenWidth >= 1920 ? 4 : (screenWidth >= 1440 ? 4 : 3), Recursive: true, Fields: "DateCreated,UserData" }; @@ -63,7 +63,7 @@ SortBy: "DateCreated", SortOrder: "Descending", IncludeItemTypes: "Trailer", - Limit: screenWidth >= 1440 ? 8 : 6, + Limit: screenWidth >= 1440 ? 7 : 6, Recursive: true, Fields: "PrimaryImageAspectRatio,DateCreated,UserData", Filters: "IsUnplayed" diff --git a/dashboard-ui/scripts/musicrecommended.js b/dashboard-ui/scripts/musicrecommended.js index 489f226e1f..c9d77bc121 100644 --- a/dashboard-ui/scripts/musicrecommended.js +++ b/dashboard-ui/scripts/musicrecommended.js @@ -11,7 +11,7 @@ SortBy: "DateCreated", SortOrder: "Descending", IncludeItemTypes: "MusicAlbum", - Limit: screenWidth >= 1920 ? 7 : (screenWidth >= 1440 ? 6 : 5), + Limit: screenWidth >= 1920 ? 6 : (screenWidth >= 1440 ? 6 : 5), Recursive: true, Fields: "PrimaryImageAspectRatio" }; @@ -34,7 +34,7 @@ SortBy: "DateCreated", SortOrder: "Descending", IncludeItemTypes: "Audio", - Limit: screenWidth >= 1920 ? 7 : (screenWidth >= 1440 ? 6 : 5), + Limit: screenWidth >= 1920 ? 6 : (screenWidth >= 1440 ? 6 : 5), Recursive: true, Fields: "PrimaryImageAspectRatio,AudioInfo" }; @@ -57,7 +57,7 @@ SortBy: "DatePlayed", SortOrder: "Descending", IncludeItemTypes: "Audio", - Limit: screenWidth >= 1920 ? 7 : (screenWidth >= 1440 ? 6 : 5), + Limit: screenWidth >= 1920 ? 6 : (screenWidth >= 1440 ? 6 : 5), Recursive: true, Fields: "PrimaryImageAspectRatio,AudioInfo", Filters: "IsPlayed" @@ -87,7 +87,7 @@ SortBy: "PlayCount", SortOrder: "Descending", IncludeItemTypes: "Audio", - Limit: screenWidth >= 1920 ? 14 : (screenWidth >= 1440 ? 12 : 10), + Limit: screenWidth >= 1920 ? 12 : (screenWidth >= 1440 ? 12 : 10), Recursive: true, Fields: "PrimaryImageAspectRatio,AudioInfo", Filters: "IsPlayed" diff --git a/dashboard-ui/scripts/tvrecommended.js b/dashboard-ui/scripts/tvrecommended.js index 11f6fe1bdb..1d97193413 100644 --- a/dashboard-ui/scripts/tvrecommended.js +++ b/dashboard-ui/scripts/tvrecommended.js @@ -38,7 +38,7 @@ SortOrder: "Descending", IncludeItemTypes: "Episode", Filters: "IsResumable", - Limit: screenWidth >= 1920 ? 5 : (screenWidth >= 1440 ? 4 : 3), + Limit: screenWidth >= 1920 ? 4 : (screenWidth >= 1440 ? 4 : 3), Recursive: true, Fields: "PrimaryImageAspectRatio,SeriesInfo,UserData", ExcludeLocationTypes: "Virtual" diff --git a/dashboard-ui/scripts/userparentalcontrol.js b/dashboard-ui/scripts/userparentalcontrol.js index af859e8b38..55a2883a6e 100644 --- a/dashboard-ui/scripts/userparentalcontrol.js +++ b/dashboard-ui/scripts/userparentalcontrol.js @@ -72,9 +72,9 @@ { name: 'Live TV Programs', value: 'LiveTvProgram' }, { name: 'Movies', value: 'Movie' }, { name: 'Music', value: 'Music' }, - { name: 'Others', value: 'Other' }, { name: 'Trailers', value: 'Trailer' }, - { name: 'TV Shows', value: 'Series' } + { name: 'TV Shows', value: 'Series' }, + { name: 'Others', value: 'Other' } ]; var html = ''; diff --git a/dashboard-ui/userparentalcontrol.html b/dashboard-ui/userparentalcontrol.html index 4bc1d179cf..26f2ca78e0 100644 --- a/dashboard-ui/userparentalcontrol.html +++ b/dashboard-ui/userparentalcontrol.html @@ -35,7 +35,6 @@
-