1
0
Fork 0
mirror of https://github.com/jellyfin/jellyfin-web synced 2025-03-30 19:56:21 +00:00

update user data queries

This commit is contained in:
Luke Pulverenti 2016-05-11 10:36:28 -04:00
parent f7e2648d79
commit 144e773ee4
37 changed files with 196 additions and 238 deletions

View file

@ -688,25 +688,34 @@
commands.push('share');
}
if (item.Type == "Movie" ||
item.Type == "Trailer" ||
item.Type == "Series" ||
item.Type == "Game" ||
item.Type == "BoxSet" ||
item.Type == "Person" ||
item.Type == "Book" ||
item.Type == "MusicAlbum" ||
item.Type == "MusicArtist") {
if (user.Policy.IsAdministrator) {
commands.push('identify');
}
if (LibraryBrowser.canIdentify(user, item.Type)) {
commands.push('identify');
}
return commands;
},
canIdentify: function(user, itemType) {
if (itemType == "Movie" ||
itemType == "Trailer" ||
itemType == "Series" ||
itemType == "Game" ||
itemType == "BoxSet" ||
itemType == "Person" ||
itemType == "Book" ||
itemType == "MusicAlbum" ||
itemType == "MusicArtist") {
if (user.Policy.IsAdministrator) {
return true;
}
}
return false;
},
refreshItem: function (itemId) {
ApiClient.refreshItem(itemId, {

View file

@ -190,7 +190,7 @@
elem.querySelector('.playlistButton').addEventListener('click', function () {
showRemoteControl('playlist');
showRemoteControl(2);
});
toggleRepeatButton = $('.toggleRepeatButton', elem).on('click', function () {
@ -254,10 +254,10 @@
}, 300);
}
function showRemoteControl(tab) {
function showRemoteControl(tabIndex) {
if (tab) {
Dashboard.navigate('nowplaying.html?tab=' + tab);
if (tabIndex) {
Dashboard.navigate('nowplaying.html?tab=' + tabIndex);
} else {
Dashboard.navigate('nowplaying.html');
}

View file

@ -1,43 +1,30 @@
define(['jQuery'], function ($) {
define(['components/remotecontrol'], function (remotecontrolFactory) {
pageIdOn('pageinit', "nowPlayingPage", function () {
return function (view, params) {
var page = this;
var self = this;
require(['components/remotecontrol'], function (remotecontrolFactory) {
page.remoteControl = new remotecontrolFactory();
page.remoteControl.init(page.querySelector('.remoteControlContent'));
page.remoteControl.onShow();
page.remoteControlInitComplete = true;
});
});
var remoteControl = new remotecontrolFactory();
remoteControl.init(view, view.querySelector('.remoteControlContent'));
pageIdOn('pagebeforeshow', "nowPlayingPage", function () {
view.addEventListener('viewbeforeshow', function (e) {
document.body.classList.add('hiddenViewMenuBar');
document.body.classList.add('hiddenNowPlayingBar');
var page = this;
document.body.classList.add('hiddenViewMenuBar');
document.body.classList.add('hiddenNowPlayingBar');
if (page.remoteControl) {
if (!page.remoteControlInitComplete) {
page.remoteControlInitComplete = true;
} else {
page.remoteControl.onShow();
if (remoteControl) {
remoteControl.onShow();
}
}
});
});
pageIdOn('pagebeforehide', "nowPlayingPage", function () {
view.addEventListener('viewbeforehide', function (e) {
var page = this;
if (remoteControl) {
remoteControl.destroy();
}
if (page.remoteControl) {
page.remoteControl.destroy();
}
document.body.classList.remove('hiddenViewMenuBar');
document.body.classList.remove('hiddenNowPlayingBar');
});
document.body.classList.remove('hiddenViewMenuBar');
document.body.classList.remove('hiddenNowPlayingBar');
});
};
});

View file

@ -2783,7 +2783,8 @@ var AppInfo = {};
defineRoute({
path: '/nowplaying.html',
dependencies: [],
dependencies: ['MaterialTabs', 'paper-icon-button-light', 'paper-slider', 'paper-button'],
controller: 'scripts/nowplayingpage',
autoFocus: false
});