Update list.js

This commit is contained in:
Cameron 2020-08-02 18:06:40 +01:00
parent 5d4b133dcf
commit 6b54d25b4d

View File

@ -14,9 +14,6 @@ import 'emby-scroller';
/* eslint-disable indent */ /* eslint-disable indent */
playbackManager = playbackManager.default || playbackManager;
loading = loading.default || loading;
function getInitialLiveTvQuery(instance, params) { function getInitialLiveTvQuery(instance, params) {
const query = { const query = {
UserId: connectionManager.getApiClient(params.serverId).getCurrentUserId(), UserId: connectionManager.getApiClient(params.serverId).getCurrentUserId(),
@ -858,6 +855,7 @@ class ItemsView {
self.alphaPickerElement = null; self.alphaPickerElement = null;
}); });
} }
getFilters() { getFilters() {
const basekey = this.getSettingsKey(); const basekey = this.getSettingsKey();
return { return {
@ -879,6 +877,7 @@ class ItemsView {
GenreIds: userSettings.getFilter(basekey + '-filter-GenreIds') GenreIds: userSettings.getFilter(basekey + '-filter-GenreIds')
}; };
} }
getSortValues() { getSortValues() {
const basekey = this.getSettingsKey(); const basekey = this.getSettingsKey();
return { return {
@ -886,6 +885,7 @@ class ItemsView {
sortOrder: userSettings.getFilter(basekey + '-sortorder') === 'Descending' ? 'Descending' : 'Ascending' sortOrder: userSettings.getFilter(basekey + '-sortorder') === 'Descending' ? 'Descending' : 'Ascending'
}; };
} }
getDefaultSortBy() { getDefaultSortBy() {
const params = this.params; const params = this.params;
const sortNameOption = this.getNameSortOption(params); const sortNameOption = this.getNameSortOption(params);
@ -896,6 +896,7 @@ class ItemsView {
return 'IsFolder,' + sortNameOption.value; return 'IsFolder,' + sortNameOption.value;
} }
getSortMenuOptions() { getSortMenuOptions() {
const sortBy = []; const sortBy = [];
const params = this.params; const params = this.params;
@ -966,6 +967,7 @@ class ItemsView {
}); });
return sortBy; return sortBy;
} }
getNameSortOption(params) { getNameSortOption(params) {
if (params.type === 'Episode') { if (params.type === 'Episode') {
return { return {
@ -979,6 +981,7 @@ class ItemsView {
value: 'SortName' value: 'SortName'
}; };
} }
getPlayCountSortOption() { getPlayCountSortOption() {
if (this.params.type === 'Programs') { if (this.params.type === 'Programs') {
return null; return null;
@ -988,8 +991,8 @@ class ItemsView {
name: globalize.translate('PlayCount'), name: globalize.translate('PlayCount'),
value: 'PlayCount,SortName' value: 'PlayCount,SortName'
}; };
} }
getDatePlayedSortOption() { getDatePlayedSortOption() {
if (this.params.type === 'Programs') { if (this.params.type === 'Programs') {
return null; return null;
@ -1000,12 +1003,9 @@ class ItemsView {
value: 'DatePlayed,SortName' value: 'DatePlayed,SortName'
}; };
} }
getCriticRatingSortOption() { getCriticRatingSortOption() {
if (this.params.type === 'Programs') { if (this.params.type === 'Programs') {
};
ItemsView.prototype.getCriticRatingSortOption = function () {
if () {
return null; return null;
} }
@ -1014,12 +1014,14 @@ class ItemsView {
value: 'CriticRating,SortName' value: 'CriticRating,SortName'
}; };
} }
getCommunityRatingSortOption() { getCommunityRatingSortOption() {
return { return {
name: globalize.translate('CommunityRating'), name: globalize.translate('CommunityRating'),
value: 'CommunityRating,SortName' value: 'CommunityRating,SortName'
}; };
} }
getVisibleFilters() { getVisibleFilters() {
const filters = []; const filters = [];
const params = this.params; const params = this.params;
@ -1047,6 +1049,7 @@ class ItemsView {
return filters; return filters;
} }
setFilterStatus(hasFilters) { setFilterStatus(hasFilters) {
this.hasFilters = hasFilters; this.hasFilters = hasFilters;
const filterButtons = this.filterButtons; const filterButtons = this.filterButtons;
@ -1074,6 +1077,7 @@ class ItemsView {
} }
} }
} }
getFilterMenuOptions() { getFilterMenuOptions() {
const params = this.params; const params = this.params;
return { return {
@ -1086,6 +1090,7 @@ class ItemsView {
Recursive: this.queryRecursive Recursive: this.queryRecursive
}; };
} }
getVisibleViewSettings() { getVisibleViewSettings() {
const item = (this.params, this.currentItem); const item = (this.params, this.currentItem);
const fields = ['showTitle']; const fields = ['showTitle'];
@ -1097,6 +1102,7 @@ class ItemsView {
fields.push('viewType'); fields.push('viewType');
return fields; return fields;
} }
getViewSettings() { getViewSettings() {
const basekey = this.getSettingsKey(); const basekey = this.getSettingsKey();
const params = this.params; const params = this.params;
@ -1126,6 +1132,7 @@ class ItemsView {
viewType: userSettings.get(basekey + '-viewType') || 'images' viewType: userSettings.get(basekey + '-viewType') || 'images'
}; };
} }
getItemTypes() { getItemTypes() {
const params = this.params; const params = this.params;
@ -1139,6 +1146,7 @@ class ItemsView {
return []; return [];
} }
getSettingsKey() { getSettingsKey() {
const values = []; const values = [];
values.push('items'); values.push('items');