diff --git a/dashboard-ui/musicalbums.html b/dashboard-ui/musicalbums.html deleted file mode 100644 index 1a7b1ff0bd..0000000000 --- a/dashboard-ui/musicalbums.html +++ /dev/null @@ -1,141 +0,0 @@ - - - - Emby - - -
-
- ${TabSuggestions} - ${TabAlbums} - ${TabAlbumArtists} - ${TabArtists} - ${TabSongs} - ${TabGenres} -
-
-
-
-
-
-
- -
-
-
- -
-
- - - -
- -
- - -
-
-
- - -
- -
-
-
- ${HeaderFilters} - - - - - - - - -
-
- -
-

${HeaderGenres}

- -
-
-
- -
-

${HeaderParentalRatings}

- -
-
-
- -
-

${HeaderTags}

- -
-
-
- -
-

${HeaderYears}

- -
-
-
- -
-
-
- - ${HeaderSortBy} - - - - - - - - - - - - - - - - - -
- -
- - ${HeaderSortOrder} - - - - - - - -
-
-
-
-
- - diff --git a/dashboard-ui/musicrecommended.html b/dashboard-ui/musicrecommended.html index 0e67b740d9..b3f4f8dea9 100644 --- a/dashboard-ui/musicrecommended.html +++ b/dashboard-ui/musicrecommended.html @@ -8,11 +8,11 @@
${TabSuggestions} - ${TabMovies} - ${TabTrailers} - ${TabCollections} - ${TabGenres} - ${TabPeople} + ${TabAlbums} + ${TabAlbumArtists} + ${TabArtists} + ${TabSongs} + ${TabGenres}
${TabSuggestions} @@ -62,6 +62,17 @@
+
+
+
+ +
+
@@ -99,25 +110,72 @@
+
+
+ +
+ ${HeaderFilters} + + + + + + + + +
+
+ +
+

${HeaderGenres}

+ +
+
+
+ +
+

${HeaderParentalRatings}

+ +
+
+
+ +
+

${HeaderTags}

+ +
+
+
+ +
+

${HeaderYears}

+ +
+
+
+ +
+
+
${HeaderFilters} - - + + - - + + - - + + - - + + - - + +

diff --git a/dashboard-ui/scripts/moviecollections.js b/dashboard-ui/scripts/moviecollections.js index 93448d5291..56f0bfc2fd 100644 --- a/dashboard-ui/scripts/moviecollections.js +++ b/dashboard-ui/scripts/moviecollections.js @@ -33,7 +33,7 @@ function getSavedQueryKey() { - return getWindowUrl(); + return getWindowUrl() + 'collections'; } function reloadItems(page) { diff --git a/dashboard-ui/scripts/moviegenres.js b/dashboard-ui/scripts/moviegenres.js index 0aa21a8c28..24ded79b8e 100644 --- a/dashboard-ui/scripts/moviegenres.js +++ b/dashboard-ui/scripts/moviegenres.js @@ -32,7 +32,7 @@ function getSavedQueryKey() { - return getWindowUrl(); + return getWindowUrl() + 'genres'; } function reloadItems(page) { diff --git a/dashboard-ui/scripts/moviepeople.js b/dashboard-ui/scripts/moviepeople.js index 0269c1a8cc..d9dda64021 100644 --- a/dashboard-ui/scripts/moviepeople.js +++ b/dashboard-ui/scripts/moviepeople.js @@ -30,7 +30,7 @@ function getSavedQueryKey() { - return getWindowUrl(); + return getWindowUrl() + 'people'; } function reloadItems(page, viewPanel) { diff --git a/dashboard-ui/scripts/movies.js b/dashboard-ui/scripts/movies.js index d6a16dc85c..323ab69ff8 100644 --- a/dashboard-ui/scripts/movies.js +++ b/dashboard-ui/scripts/movies.js @@ -35,7 +35,7 @@ function getSavedQueryKey() { - return getWindowUrl(); + return getWindowUrl() + 'movies'; } function reloadItems(page, viewPanel) { @@ -278,12 +278,11 @@ $('.alphabetPicker', tabContent).alphaValue(query.NameStartsWithOrGreater); } - var filtersLoaded; function reloadFiltersIfNeeded(tabContent, viewPanel) { - if (!filtersLoaded) { + if (!getPageData().filtersLoaded) { - filtersLoaded = true; + getPageData().filtersLoaded = true; var query = getQuery(); QueryFilters.loadFilters(viewPanel, Dashboard.getCurrentUserId(), query, function () { diff --git a/dashboard-ui/scripts/moviestudios.js b/dashboard-ui/scripts/moviestudios.js index 033e513d3f..4e462d5533 100644 --- a/dashboard-ui/scripts/moviestudios.js +++ b/dashboard-ui/scripts/moviestudios.js @@ -29,7 +29,7 @@ function getSavedQueryKey() { - return getWindowUrl(); + return getWindowUrl() + 'studios' } function reloadItems(page) { diff --git a/dashboard-ui/scripts/movietrailers.js b/dashboard-ui/scripts/movietrailers.js index 7e9b8456ab..56db22666e 100644 --- a/dashboard-ui/scripts/movietrailers.js +++ b/dashboard-ui/scripts/movietrailers.js @@ -29,7 +29,7 @@ function getSavedQueryKey() { - return getWindowUrl(); + return getWindowUrl() + 'trailers'; } function reloadItems(page, viewPanel) { diff --git a/dashboard-ui/scripts/musicalbumartists.js b/dashboard-ui/scripts/musicalbumartists.js index e60888d441..da7fcf9dec 100644 --- a/dashboard-ui/scripts/musicalbumartists.js +++ b/dashboard-ui/scripts/musicalbumartists.js @@ -33,7 +33,7 @@ function getSavedQueryKey() { - return getWindowUrl(); + return getWindowUrl() + 'albumartists'; } function reloadItems(page) { @@ -141,12 +141,11 @@ $('#selectPageSize', page).val(query.Limit); } - var filtersLoaded; function reloadFiltersIfNeeded(page) { - if (!filtersLoaded) { + if (!getPageData().filtersLoaded) { - filtersLoaded = true; + getPageData().filtersLoaded = true; var query = getQuery(); diff --git a/dashboard-ui/scripts/musicalbums.js b/dashboard-ui/scripts/musicalbums.js index 7ace2feef6..f799364f4f 100644 --- a/dashboard-ui/scripts/musicalbums.js +++ b/dashboard-ui/scripts/musicalbums.js @@ -1,11 +1,7 @@ (function ($, document) { - var view = LibraryBrowser.getDefaultItemsView('Poster', 'Poster'); - var data = {}; - - function getQuery() { - + function getPageData() { var key = getSavedQueryKey(); var pageData = data[key]; @@ -21,21 +17,27 @@ ImageTypeLimit: 1, EnableImageTypes: "Primary,Backdrop,Banner,Thumb", Limit: LibraryBrowser.getDefaultPageSize() - } + }, + view: LibraryBrowser.getSavedView(key) || LibraryBrowser.getDefaultItemsView('Poster', 'Poster') }; pageData.query.ParentId = LibraryMenu.getTopParentId(); LibraryBrowser.loadSavedQueryValues(key, pageData.query); } - return pageData.query; + return pageData; + } + + function getQuery() { + + return getPageData().query; } function getSavedQueryKey() { - return getWindowUrl(); + return getWindowUrl() + 'albums'; } - function reloadItems(page) { + function reloadItems(page, viewPanel) { Dashboard.showLoadingMsg(); @@ -47,18 +49,24 @@ window.scrollTo(0, 0); var html = ''; + var view = getPageData().view; var pagingHtml = LibraryBrowser.getQueryPagingHtml({ startIndex: query.StartIndex, limit: query.Limit, totalRecordCount: result.TotalRecordCount, viewButton: true, showLimit: false, - addSelectionButton: true + addSelectionButton: true, + sortButton: true, + viewPanelClass: 'albumsViewPanel', + addLayoutButton: true, + currentLayout: view, + updatePageSizeSetting: false }); page.querySelector('.listTopPaging').innerHTML = pagingHtml; - updateFilterControls(page); + updateFilterControls(page, viewPanel); var trigger = false; if (view == "Poster") { @@ -117,12 +125,52 @@ $('.btnNextPage', page).on('click', function () { query.StartIndex += query.Limit; - reloadItems(page); + reloadItems(page, viewPanel); }); $('.btnPreviousPage', page).on('click', function () { query.StartIndex -= query.Limit; - reloadItems(page); + reloadItems(page, viewPanel); + }); + + $('.btnChangeLayout', page).on('layoutchange', function (e, layout) { + getPageData().view = layout; + LibraryBrowser.saveViewSetting(getSavedQueryKey(), layout); + reloadItems(page, viewPanel); + }); + + // On callback make sure to set StartIndex = 0 + $('.btnSort', page).on('click', function () { + LibraryBrowser.showSortMenu({ + items: [{ + name: Globalize.translate('OptionNameSort'), + id: 'SortName' + }, + { + name: Globalize.translate('OptionAlbumArtist'), + id: 'AlbumArtist,SortName' + }, + { + name: Globalize.translate('OptionCommunityRating'), + id: 'CommunityRating,SortName' + }, + { + name: Globalize.translate('OptionCriticRating'), + id: 'CriticRating,SortName' + }, + { + name: Globalize.translate('OptionDateAdded'), + id: 'DateCreated,SortName' + }, + { + name: Globalize.translate('OptionReleaseDate'), + id: 'ProductionYear,PremiereDate,SortName' + }], + callback: function () { + reloadItems(page, viewPanel); + }, + query: query + }); }); LibraryBrowser.saveQueryValues(getSavedQueryKey(), query); @@ -131,85 +179,37 @@ }); } - function updateFilterControls(page) { + function updateFilterControls(page, viewPanel) { var query = getQuery(); - $('#selectView', page).val(view); - - // Reset form values using the last used query - $('.radioSortBy', page).each(function () { - - this.checked = (query.SortBy || '').toLowerCase() == this.getAttribute('data-sortby').toLowerCase(); - - }).checkboxradio('refresh'); - - $('.radioSortOrder', page).each(function () { - - this.checked = (query.SortOrder || '').toLowerCase() == this.getAttribute('data-sortorder').toLowerCase(); - - }).checkboxradio('refresh'); - $('.alphabetPicker', page).alphaValue(query.NameStartsWith); - $('#selectPageSize', page).val(query.Limit); } - var filtersLoaded; - function reloadFiltersIfNeeded(page) { + function reloadFiltersIfNeeded(page, viewPanel) { - if (!filtersLoaded) { + if (!getPageData().filtersLoaded) { - filtersLoaded = true; + getPageData().filtersLoaded = true; var query = getQuery(); + QueryFilters.loadFilters(viewPanel, Dashboard.getCurrentUserId(), query, function () { - QueryFilters.loadFilters(page, Dashboard.getCurrentUserId(), query, function () { - - reloadItems(page); + reloadItems(page, viewPanel); }); } } - $(document).on('pageinit', "#musicAlbumsPage", function () { + function initPage(tabContent, viewPanel) { - var page = this; + $(viewPanel).on('panelopen', function () { - $('.viewPanel', page).on('panelopen', function () { - - reloadFiltersIfNeeded(page); + reloadFiltersIfNeeded(tabContent, viewPanel); }); - $('.radioSortBy', page).on('click', function () { + $('.chkStandardFilter', viewPanel).on('change', function () { + var query = getQuery(); - - query.SortBy = this.getAttribute('data-sortby'); - query.StartIndex = 0; - - // Clear this - $('.alphabetPicker', page).alphaClear(); - query.NameStartsWithOrGreater = ''; - query.AlbumArtistStartsWithOrGreater = ''; - - reloadItems(page); - }); - - $('.radioSortOrder', page).on('click', function () { - var query = getQuery(); - - query.SortOrder = this.getAttribute('data-sortorder'); - query.StartIndex = 0; - - // Clear this - $('.alphabetPicker', page).alphaClear(); - query.NameStartsWithOrGreater = ''; - query.AlbumArtistStartsWithOrGreater = ''; - - reloadItems(page); - }); - - $('.chkStandardFilter', page).on('change', function () { - var query = getQuery(); - var filterName = this.getAttribute('data-filter'); var filters = query.Filters || ""; @@ -222,29 +222,10 @@ query.StartIndex = 0; query.Filters = filters; - reloadItems(page); + reloadItems(tabContent, viewPanel); }); - $('#selectView', page).on('change', function () { - - view = this.value; - - var query = getQuery(); - - if (view == "Timeline") { - - query.SortBy = "PremiereDate"; - query.SortOrder = "Descending"; - query.StartIndex = 0; - $('#radioPremiereDate', page)[0].click(); - - } else { - reloadItems(page); - } - LibraryBrowser.saveViewSetting(getSavedQueryKey(), view); - }); - - $('.alphabetPicker', page).on('alphaselect', function (e, character) { + $('.alphabetPicker', tabContent).on('alphaselect', function (e, character) { var query = getQuery(); @@ -258,7 +239,7 @@ query.StartIndex = 0; - reloadItems(page); + reloadItems(tabContent, viewPanel); }).on('alphaclear', function (e) { @@ -267,36 +248,22 @@ query.NameStartsWithOrGreater = ''; query.AlbumArtistStartsWithOrGreater = ''; - reloadItems(page); + reloadItems(tabContent, viewPanel); }); + } - $('#selectPageSize', page).on('change', function () { - var query = getQuery(); + window.MusicPage.initAlbumsTab = function (page, tabContent) { - query.Limit = parseInt(this.value); - query.StartIndex = 0; - reloadItems(page); - }); + var viewPanel = page.querySelector('.albumsViewPanel'); + initPage(tabContent, viewPanel); + }; - }).on('pagebeforeshow', "#musicAlbumsPage", function () { + window.MusicPage.renderAlbumsTab = function (page, tabContent) { - var page = this; - - var query = getQuery(); - QueryFilters.onPageShow(page, query); - - if (LibraryBrowser.needsRefresh(page)) { - LibraryBrowser.getSavedViewSetting(getSavedQueryKey()).done(function (val) { - - if (val) { - $('#selectView', page).val(val).trigger('change'); - } else { - reloadItems(page); - } - }); + if (LibraryBrowser.needsRefresh(tabContent)) { + var viewPanel = page.querySelector('.albumsViewPanel'); + reloadItems(tabContent, viewPanel); } - - updateFilterControls(this); - }); + }; })(jQuery, document); \ No newline at end of file diff --git a/dashboard-ui/scripts/musicartists.js b/dashboard-ui/scripts/musicartists.js index 1531332749..58a218d5f1 100644 --- a/dashboard-ui/scripts/musicartists.js +++ b/dashboard-ui/scripts/musicartists.js @@ -33,7 +33,7 @@ function getSavedQueryKey() { - return getWindowUrl(); + return getWindowUrl() + 'artists'; } function reloadItems(page) { @@ -140,13 +140,12 @@ $('#selectPageSize', page).val(query.Limit); } - var filtersLoaded; function reloadFiltersIfNeeded(page) { var query = getQuery(); - if (!filtersLoaded) { + if (!getPageData().filtersLoaded) { - filtersLoaded = true; + getPageData().filtersLoaded = true; QueryFilters.loadFilters(page, Dashboard.getCurrentUserId(), query, function () { diff --git a/dashboard-ui/scripts/musicgenres.js b/dashboard-ui/scripts/musicgenres.js index 7bef49e390..7944a29b12 100644 --- a/dashboard-ui/scripts/musicgenres.js +++ b/dashboard-ui/scripts/musicgenres.js @@ -32,7 +32,7 @@ function getSavedQueryKey() { - return getWindowUrl(); + return getWindowUrl() + 'genres'; } function reloadItems(page) { diff --git a/dashboard-ui/scripts/musicrecommended.js b/dashboard-ui/scripts/musicrecommended.js index 46de45cdc2..4ca8eb838f 100644 --- a/dashboard-ui/scripts/musicrecommended.js +++ b/dashboard-ui/scripts/musicrecommended.js @@ -220,10 +220,10 @@ renderMethod = 'renderSuggestedTab'; break; case 1: - depends.push('scripts/movies'); + depends.push('scripts/musicalbums'); + renderMethod = 'renderAlbumsTab'; + initMethod = 'initAlbumsTab'; depends.push('scripts/queryfilters'); - renderMethod = 'renderMoviesTab'; - initMethod = 'initMoviesTab'; break; case 2: depends.push('scripts/movietrailers'); diff --git a/dashboard-ui/scripts/songs.js b/dashboard-ui/scripts/songs.js index a9079c3a9c..373835f7b3 100644 --- a/dashboard-ui/scripts/songs.js +++ b/dashboard-ui/scripts/songs.js @@ -35,7 +35,7 @@ function getSavedQueryKey() { - return getWindowUrl(); + return getWindowUrl() + 'songs'; } function reloadItems(page, viewPanel) { @@ -89,20 +89,20 @@ $('.btnSort', page).on('click', function () { LibraryBrowser.showSortMenu({ items: [{ - name: Globalize.translate('OptionNameSort'), - id: 'SortName' + name: Globalize.translate('OptionTrackName'), + id: 'Name' }, { - name: Globalize.translate('OptionBudget'), - id: 'Budget,SortName' + name: Globalize.translate('OptionAlbum'), + id: 'Album,SortName' }, { - name: Globalize.translate('OptionImdbRating'), - id: 'CommunityRating,SortName' + name: Globalize.translate('OptionAlbumArtist'), + id: 'AlbumArtist,Album,SortName' }, { - name: Globalize.translate('OptionCriticRating'), - id: 'CriticRating,SortName' + name: Globalize.translate('OptionArtist'), + id: 'Artist,Album,SortName' }, { name: Globalize.translate('OptionDateAdded'), @@ -112,33 +112,17 @@ name: Globalize.translate('OptionDatePlayed'), id: 'DatePlayed,SortName' }, - { - name: Globalize.translate('OptionMetascore'), - id: 'Metascore,SortName' - }, - { - name: Globalize.translate('OptionParentalRating'), - id: 'OfficialRating,SortName' - }, { name: Globalize.translate('OptionPlayCount'), id: 'PlayCount,SortName' }, { name: Globalize.translate('OptionReleaseDate'), - id: 'PremiereDate,SortName' - }, - { - name: Globalize.translate('OptionRevenue'), - id: 'Revenue,SortName' + id: 'PremiereDate,AlbumArtist,Album,SortName' }, { name: Globalize.translate('OptionRuntime'), - id: 'Runtime,SortName' - }, - { - name: Globalize.translate('OptionVideoBitrate'), - id: 'VideoBitRate,SortName' + id: 'Runtime,AlbumArtist,Album,SortName' }], callback: function () { reloadItems(page, viewPanel); @@ -153,12 +137,11 @@ }); } - var filtersLoaded; function reloadFiltersIfNeeded(page, viewPanel) { - if (!filtersLoaded) { + if (!getPageData().filtersLoaded) { - filtersLoaded = true; + getPageData().filtersLoaded = true; var query = getQuery(); QueryFilters.loadFilters(viewPanel, Dashboard.getCurrentUserId(), query, function () { diff --git a/dashboard-ui/strings/javascript/javascript.json b/dashboard-ui/strings/javascript/javascript.json index b56cb96025..e992e7bebd 100644 --- a/dashboard-ui/strings/javascript/javascript.json +++ b/dashboard-ui/strings/javascript/javascript.json @@ -862,6 +862,11 @@ "OptionDateAdded": "Date Added", "OptionPlayCount": "Play Count", "ButtonDisconnect": "Disconnect", + "OptionAlbumArtist": "Album Artist", + "OptionArtist": "Artist", + "OptionAlbum": "Album", + "OptionTrackName": "Track Name", + "OptionCommunityRating": "Community Rating", "ButtonSort": "Sort", "ButtonMenu": "Menu", "ButtonFilter": "Filter",