diff --git a/dashboard-ui/edititemmetadata.html b/dashboard-ui/edititemmetadata.html index 2b74dbde31..c6c08712a4 100644 --- a/dashboard-ui/edititemmetadata.html +++ b/dashboard-ui/edititemmetadata.html @@ -166,7 +166,7 @@

diff --git a/dashboard-ui/itembynamedetails.html b/dashboard-ui/itembynamedetails.html index f7668623df..e175133f74 100644 --- a/dashboard-ui/itembynamedetails.html +++ b/dashboard-ui/itembynamedetails.html @@ -75,6 +75,7 @@ Albums Artists Genres + Music Videos

+ +
diff --git a/dashboard-ui/musicartists.html b/dashboard-ui/musicartists.html index ca81b09d99..c54334a251 100644 --- a/dashboard-ui/musicartists.html +++ b/dashboard-ui/musicartists.html @@ -11,6 +11,7 @@ Albums Artists Genres + Music Videos
diff --git a/dashboard-ui/musicgenres.html b/dashboard-ui/musicgenres.html index 1f521e4cb8..5c47dec2fb 100644 --- a/dashboard-ui/musicgenres.html +++ b/dashboard-ui/musicgenres.html @@ -11,6 +11,7 @@ Albums Artists Genres + Music Videos
diff --git a/dashboard-ui/musicrecommended.html b/dashboard-ui/musicrecommended.html index 7f708374da..92b6badbcf 100644 --- a/dashboard-ui/musicrecommended.html +++ b/dashboard-ui/musicrecommended.html @@ -11,6 +11,7 @@ Albums Artists Genres + Music Videos
diff --git a/dashboard-ui/musicvideos.html b/dashboard-ui/musicvideos.html new file mode 100644 index 0000000000..b976977737 --- /dev/null +++ b/dashboard-ui/musicvideos.html @@ -0,0 +1,155 @@ + + + + Media Browser + + +
+ + + +
+
+
+
+
+
+ +
+ + +
+
+
+
+
+
+
+ +
+
+ + Sort By: + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + Sort Order: + + + + + + + +
+ +
+
+
+
+ + Filters: + + + + + + + + + + + + + + + + + + +
+
+ + Type: + + + + + + + + + + + + + +
+ +
+ + Features: + + + + + + + + + + + + + + +
+ + +
+
+ + diff --git a/dashboard-ui/scripts/Itemdetailpage.js b/dashboard-ui/scripts/Itemdetailpage.js index b86038c9e7..aec56d57f0 100644 --- a/dashboard-ui/scripts/Itemdetailpage.js +++ b/dashboard-ui/scripts/Itemdetailpage.js @@ -70,7 +70,7 @@ if (item.Type == "Movie" || item.Type == "Trailer" || item.Type == "BoxSet") { return "movies"; } - if (item.Type == "Audio" || item.Type == "MusicAlbum" || item.Type == "MusicArtist" || item.Type == "Artist") { + if (item.Type == "Audio" || item.Type == "MusicAlbum" || item.Type == "MusicArtist" || item.Type == "Artist" || item.Type == "MusicVideo") { return "music"; } if (item.MediaType == "Game") { @@ -87,6 +87,10 @@ $('#albumTabs', page).show(); } + if (item.Type == "MusicVideo") { + $('#musicVideoTabs', page).show(); + } + if (item.Type == "Audio") { $('#songTabs', page).show(); } @@ -435,7 +439,7 @@ function renderCriticReviews(page, item, limit) { - if (item.Type != "Movie" && item.Type != "Trailer") { + if (item.Type != "Movie" && item.Type != "Trailer" && item.Type != "MusicVideo") { $('#criticReviewsCollapsible', page).hide(); return; } diff --git a/dashboard-ui/scripts/edititemmetadata.js b/dashboard-ui/scripts/edititemmetadata.js index 3d24440284..a1456f4f8c 100644 --- a/dashboard-ui/scripts/edititemmetadata.js +++ b/dashboard-ui/scripts/edititemmetadata.js @@ -40,7 +40,7 @@ $('#fldEndDate', page).hide(); } - if (item.Type == "Movie" || item.MediaType == "Game" || item.MediaType == "Trailer") { + if (item.Type == "Movie" || item.MediaType == "Game" || item.MediaType == "Trailer" || item.Type == "MusicVideo") { $('#fldBudget', page).show(); $('#fldRevenue', page).show(); } else { @@ -56,7 +56,7 @@ $('#fldGamesDb', page).hide(); } - if (item.Type == "Movie" || item.Type == "Trailer") { + if (item.Type == "Movie" || item.Type == "Trailer" || item.Type == "MusicVideo") { $('#fldCriticRating', page).show(); $('#fldCriticRatingSummary', page).show(); $('#fldRottenTomatoes', page).show(); @@ -90,7 +90,7 @@ $('#fldAlbumArtist', page).hide(); } - if (item.Type == "Movie" || item.Type == "Trailer" || item.Type == "Person" || item.Type == "Series" || item.Type == "Season" || item.Type == "Episode") { + if (item.Type == "Movie" || item.Type == "Trailer" || item.Type == "Person" || item.Type == "Series" || item.Type == "Season" || item.Type == "Episode" || item.Type == "MusicVideo") { $('#fldImdb', page).show(); } else { $('#fldImdb', page).hide(); diff --git a/dashboard-ui/scripts/itembynamedetailpage.js b/dashboard-ui/scripts/itembynamedetailpage.js index f5aebe8ab9..8ca073a715 100644 --- a/dashboard-ui/scripts/itembynamedetailpage.js +++ b/dashboard-ui/scripts/itembynamedetailpage.js @@ -64,7 +64,7 @@ var vals = [item.Type, item.Id, item.Name]; var context = getParameterByName('context'); - + if (context) { vals.push(vals); } @@ -188,6 +188,12 @@ html += ''; } + if (result.MusicVideoCount) { + + html += ''; + html += ''; + } + html += ''; var elem = $('#itemTabs', page).html(html).trigger('create'); @@ -207,6 +213,18 @@ function bindRadioEvents(page) { + $("#radioMusicVideos", page).on("click", function () { + + shape = "poster"; + loadItems(page, { + MediaTypes: "", + IncludeItemTypes: "MusicVideo", + PersonTypes: "", + Artists: "" + }); + + }); + $("#radioMovies", page).on("click", function () { shape = "poster"; @@ -398,15 +416,15 @@ } if (query.IncludeItemTypes == "Audio") { - + html += LibraryBrowser.getSongTableHtml(result.Items, { showAlbum: true, showArtist: true }); - + } else { - + html += LibraryBrowser.getPosterDetailViewHtml({ items: result.Items, preferBackdrop: shape == "backdrop", diff --git a/dashboard-ui/scripts/librarybrowser.js b/dashboard-ui/scripts/librarybrowser.js index a4bd497906..11332bb5e9 100644 --- a/dashboard-ui/scripts/librarybrowser.js +++ b/dashboard-ui/scripts/librarybrowser.js @@ -565,9 +565,9 @@ return html; }, - - getPosterViewDisplayName: function(item) { - + + getPosterViewDisplayName: function (item) { + var name = item.Name; if (item.Type == "Episode" && item.IndexNumber != null && item.ParentIndexNumber != null) { @@ -677,7 +677,7 @@ renderName: function (item, nameElem, linkToElement) { var name = LibraryBrowser.getPosterViewDisplayName(item); - + Dashboard.setPageTitle(name); if (linkToElement) { @@ -740,13 +740,15 @@ var providerIds = item.ProviderIds || {}; if (providerIds.Imdb) { - if (item.Type == "Movie" || item.Type == "Episode" || item.Type == "Trailer") - links.push('IMDb'); - else if (item.Type == "Person") + if (item.Type == "Person") { links.push('IMDb'); + } + else { + links.push('IMDb'); + } } if (providerIds.Tmdb) { - if (item.Type == "Movie" || item.Type == "Trailer") + if (item.Type == "Movie" || item.Type == "Trailer" || item.Type == "MusicVideo") links.push('TheMovieDB'); else if (item.Type == "BoxSet") links.push('TheMovieDB'); @@ -879,7 +881,7 @@ } } - if ((item.Type == "Movie" || item.Type == "Trailer") && item.CriticRating != null) { + if (item.CriticRating != null) { if (item.CriticRating >= 60) { html += '
'; diff --git a/dashboard-ui/scripts/mediaplayer.js b/dashboard-ui/scripts/mediaplayer.js index 539ac4a193..a29ccb6510 100644 --- a/dashboard-ui/scripts/mediaplayer.js +++ b/dashboard-ui/scripts/mediaplayer.js @@ -298,7 +298,7 @@ percent *= 100; positionSlider.val(percent); - + positionSlider.removeAttr('disabled'); } } else { @@ -533,7 +533,7 @@ $('#qualityButton', nowPlayingBar).show(); - if (item.MediaStreams.filter(function(i) { + if (item.MediaStreams.filter(function (i) { return i.Type == "Audio"; }).length) { $('#audioTracksButton', nowPlayingBar).show(); @@ -851,10 +851,12 @@ } html += "
"; - if (item.Type == "Movie") - html += '
' + name + '
' + seriesName + '
'; - else + + if (item.SeriesName || item.Album) { html += '
' + seriesName + '
' + name + '
'; + } else { + html += '
' + name + '
' + seriesName + '
'; + } $('.nowPlayingMediaInfo', nowPlayingBar).html(html); }; @@ -1254,7 +1256,7 @@ var option = options[i]; var cssClass = "mediaFlyoutOption"; - + if (option.videoBitrate == currentVideoBitrate) { cssClass += " selectedMediaFlyoutOption"; } diff --git a/dashboard-ui/scripts/musicvideos.js b/dashboard-ui/scripts/musicvideos.js new file mode 100644 index 0000000000..5b2b53c199 --- /dev/null +++ b/dashboard-ui/scripts/musicvideos.js @@ -0,0 +1,264 @@ +(function ($, document) { + + var view = "Poster"; + + // The base query options + var query = { + + SortBy: "SortName", + SortOrder: "Ascending", + IncludeItemTypes: "MusicVideo", + Recursive: true, + Fields: "UserData,DisplayMediaType,ItemCounts,DateCreated", + StartIndex: 0 + }; + + function reloadItems(page) { + + Dashboard.showLoadingMsg(); + + ApiClient.getItems(Dashboard.getCurrentUserId(), query).done(function (result) { + + // Scroll back up so they can see the results from the beginning + $(document).scrollTop(0); + + var html = ''; + + $('.listTopPaging', page).html(LibraryBrowser.getPagingHtml(query, result.TotalRecordCount, true)).trigger('create'); + + if (view == "Backdrop") { + html += LibraryBrowser.getPosterDetailViewHtml({ + items: result.Items, + preferBackdrop: true, + context: "music", + shape: "backdrop" + }); + $('.itemsContainer', page).removeClass('timelineItemsContainer'); + } + else if (view == "Poster") { + html += LibraryBrowser.getPosterDetailViewHtml({ + items: result.Items, + context: "music", + shape: "poster" + }); + $('.itemsContainer', page).removeClass('timelineItemsContainer'); + } + else if (view == "Timeline") { + html += LibraryBrowser.getPosterDetailViewHtml({ + items: result.Items, + context: "music", + shape: "poster", + timeline: true + }); + $('.itemsContainer', page).addClass('timelineItemsContainer'); + } + + html += LibraryBrowser.getPagingHtml(query, result.TotalRecordCount); + + $('#items', page).html(html).trigger('create'); + + $('.selectPage', page).on('change', function () { + query.StartIndex = (parseInt(this.value) - 1) * query.Limit; + reloadItems(page); + }); + + $('.btnNextPage', page).on('click', function () { + query.StartIndex += query.Limit; + reloadItems(page); + }); + + $('.btnPreviousPage', page).on('click', function () { + query.StartIndex -= query.Limit; + reloadItems(page); + }); + + $('.selectPageSize', page).on('change', function () { + query.Limit = parseInt(this.value); + query.StartIndex = 0; + reloadItems(page); + }); + + Dashboard.hideLoadingMsg(); + }); + } + + $(document).on('pageinit', "#musicVideosPage", function () { + + var page = this; + + $('.radioSortBy', this).on('click', function () { + query.StartIndex = 0; + query.SortBy = this.getAttribute('data-sortby'); + reloadItems(page); + }); + + $('.radioSortOrder', this).on('click', function () { + query.StartIndex = 0; + query.SortOrder = this.getAttribute('data-sortorder'); + reloadItems(page); + }); + + $('.chkStandardFilter', this).on('change', function () { + + var filterName = this.getAttribute('data-filter'); + var filters = query.Filters || ""; + + filters = (',' + filters).replace(',' + filterName, '').substring(1); + + if (this.checked) { + filters = filters ? (filters + ',' + filterName) : filterName; + } + + query.StartIndex = 0; + query.Filters = filters; + + reloadItems(page); + }); + + + $('.chkVideoTypeFilter', this).on('change', function () { + + var filterName = this.getAttribute('data-filter'); + var filters = query.VideoTypes || ""; + + filters = (',' + filters).replace(',' + filterName, '').substring(1); + + if (this.checked) { + filters = filters ? (filters + ',' + filterName) : filterName; + } + + query.StartIndex = 0; + query.VideoTypes = filters; + + reloadItems(page); + }); + + $('#selectView', this).on('change', function () { + + view = this.value; + + if (view == "Timeline") { + + query.SortBy = "PremiereDate"; + query.StartIndex = 0; + $('#radioPremiereDate', page)[0].click(); + + } else { + reloadItems(page); + } + + }); + + $('#chk3D', this).on('change', function () { + + query.StartIndex = 0; + query.VideoFormats = this.checked ? this.getAttribute('data-filter') : null; + + reloadItems(page); + }); + + $('#chkSubtitle', this).on('change', function () { + + query.StartIndex = 0; + query.HasSubtitles = this.checked ? true : null; + + reloadItems(page); + }); + + $('#chkTrailer', this).on('change', function () { + + query.StartIndex = 0; + query.HasTrailer = this.checked ? true : null; + + reloadItems(page); + }); + + $('#chkThemeSong', this).on('change', function () { + + query.StartIndex = 0; + query.HasThemeSong = this.checked ? true : null; + + reloadItems(page); + }); + + $('#chkThemeVideo', this).on('change', function () { + + query.StartIndex = 0; + query.HasThemeVideo = this.checked ? true : null; + + reloadItems(page); + }); + + $('.alphabetPicker', this).on('alphaselect', function (e, character) { + + query.NameStartsWithOrGreater = character; + query.StartIndex = 0; + + reloadItems(page); + + }).on('alphaclear', function (e) { + + query.NameStartsWithOrGreater = ''; + + reloadItems(page); + }); + + }).on('pagebeforeshow', "#musicVideosPage", function () { + + var limit = LibraryBrowser.getDefaultPageSize(); + + // If the default page size has changed, the start index will have to be reset + if (limit != query.Limit) { + query.Limit = limit; + query.StartIndex = 0; + } + + reloadItems(this); + + }).on('pageshow', "#musicVideosPage", function () { + + // Reset form values using the last used query + $('.radioSortBy', this).each(function () { + + this.checked = query.SortBy == this.getAttribute('data-sortby'); + + }).checkboxradio('refresh'); + + $('.radioSortOrder', this).each(function () { + + this.checked = query.SortOrder == this.getAttribute('data-sortorder'); + + }).checkboxradio('refresh'); + + $('.chkStandardFilter', this).each(function () { + + var filters = "," + (query.Filters || ""); + var filterName = this.getAttribute('data-filter'); + + this.checked = filters.indexOf(',' + filterName) != -1; + + }).checkboxradio('refresh'); + + $('.chkVideoTypeFilter', this).each(function () { + + var filters = "," + (query.VideoTypes || ""); + var filterName = this.getAttribute('data-filter'); + + this.checked = filters.indexOf(',' + filterName) != -1; + + }).checkboxradio('refresh'); + + $('#selectView', this).val(view).selectmenu('refresh'); + + $('#chk3D', this).checked(query.VideoFormats == "Digital3D,Sbs3D").checkboxradio('refresh'); + + $('#chkSubtitle', this).checked(query.HasSubtitles == true).checkboxradio('refresh'); + $('#chkTrailer', this).checked(query.HasTrailer == true).checkboxradio('refresh'); + $('#chkThemeSong', this).checked(query.HasThemeSong == true).checkboxradio('refresh'); + $('#chkThemeVideo', this).checked(query.HasThemeVideo == true).checkboxradio('refresh'); + + $('.alphabetPicker', this).alphaValue(query.NameStartsWithOrGreater); + + }); + +})(jQuery, document); \ No newline at end of file diff --git a/dashboard-ui/scripts/search.js b/dashboard-ui/scripts/search.js index e6215d55d1..ca8d58941b 100644 --- a/dashboard-ui/scripts/search.js +++ b/dashboard-ui/scripts/search.js @@ -160,6 +160,11 @@ html += '
Movie
'; + } + else if (hint.Type == "MusicVideo") { + + html += '
Music Video
'; + } else if (hint.Type == "Episode") { diff --git a/dashboard-ui/songs.html b/dashboard-ui/songs.html index 79328807cc..0b5c9be0b6 100644 --- a/dashboard-ui/songs.html +++ b/dashboard-ui/songs.html @@ -11,6 +11,7 @@ AlbumsArtistsGenres + Music Videos