mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
update listviews
This commit is contained in:
parent
722a452b91
commit
c87b1304da
10 changed files with 134 additions and 860 deletions
|
@ -15,12 +15,12 @@
|
|||
},
|
||||
"devDependencies": {},
|
||||
"ignore": [],
|
||||
"version": "1.4.89",
|
||||
"_release": "1.4.89",
|
||||
"version": "1.4.90",
|
||||
"_release": "1.4.90",
|
||||
"_resolution": {
|
||||
"type": "version",
|
||||
"tag": "1.4.89",
|
||||
"commit": "fb661d66f08795bad7137b9a193c7fd07d6ab9c8"
|
||||
"tag": "1.4.90",
|
||||
"commit": "36704279e05a90730af96c13b16c60ecc30cdce8"
|
||||
},
|
||||
"_source": "https://github.com/MediaBrowser/emby-webcomponents.git",
|
||||
"_target": "^1.2.0",
|
||||
|
|
|
@ -33,6 +33,7 @@
|
|||
button = parentWithAttribute(button, 'data-id');
|
||||
var serverId = button.getAttribute('data-serverid');
|
||||
var id = button.getAttribute('data-id');
|
||||
var type = button.getAttribute('data-type');
|
||||
|
||||
var apiClient = connectionManager.getApiClient(serverId);
|
||||
|
||||
|
@ -50,7 +51,8 @@
|
|||
play: true,
|
||||
queue: true,
|
||||
playAllFromHere: !item.IsFolder,
|
||||
queueAllFromHere: !item.IsFolder
|
||||
queueAllFromHere: !item.IsFolder,
|
||||
identify: false
|
||||
|
||||
}).then(function(result) {
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
define(['apphost', 'globalize', 'connectionManager', 'itemHelper', 'embyRouter', 'playbackManager'], function (appHost, globalize, connectionManager, itemHelper, embyRouter, playbackManager) {
|
||||
|
||||
var isTheater = true;
|
||||
appHost.appInfo().then(function(result) {
|
||||
appHost.appInfo().then(function (result) {
|
||||
isTheater = result.appName.toLowerCase().indexOf('theater') != -1;
|
||||
});
|
||||
|
||||
|
@ -85,10 +85,12 @@ define(['apphost', 'globalize', 'connectionManager', 'itemHelper', 'embyRouter',
|
|||
}
|
||||
|
||||
if (options.open !== false) {
|
||||
commands.push({
|
||||
name: globalize.translate('sharedcomponents#Open'),
|
||||
id: 'open'
|
||||
});
|
||||
if (item.Type != 'Timer') {
|
||||
commands.push({
|
||||
name: globalize.translate('sharedcomponents#Open'),
|
||||
id: 'open'
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
if (options.play !== false) {
|
||||
|
@ -121,19 +123,31 @@ define(['apphost', 'globalize', 'connectionManager', 'itemHelper', 'embyRouter',
|
|||
}
|
||||
}
|
||||
|
||||
if (user.Policy.IsAdministrator) {
|
||||
if (item.Type == 'Program' && (!item.TimerId && !item.SeriesTimerId)) {
|
||||
|
||||
commands.push({
|
||||
name: globalize.translate('sharedcomponents#Refresh'),
|
||||
id: 'refresh'
|
||||
name: Globalize.translate('sharedcomponents#Record'),
|
||||
id: 'record'
|
||||
});
|
||||
}
|
||||
|
||||
if (item.Type != 'Timer' && user.Policy.EnablePublicSharing && appHost.supports('sharing')) {
|
||||
commands.push({
|
||||
name: globalize.translate('sharedcomponents#Share'),
|
||||
id: 'share'
|
||||
});
|
||||
if (user.Policy.IsAdministrator) {
|
||||
|
||||
if (item.Type != 'Timer') {
|
||||
commands.push({
|
||||
name: globalize.translate('sharedcomponents#Refresh'),
|
||||
id: 'refresh'
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
if (options.share !== false) {
|
||||
if (itemHelper.canShare(user, item)) {
|
||||
commands.push({
|
||||
name: globalize.translate('sharedcomponents#Share'),
|
||||
id: 'share'
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
if (item.IsFolder || item.Type == "MusicArtist" || item.Type == "MusicGenre") {
|
||||
|
@ -247,10 +261,7 @@ define(['apphost', 'globalize', 'connectionManager', 'itemHelper', 'embyRouter',
|
|||
}
|
||||
case 'edit':
|
||||
{
|
||||
require(['components/metadataeditor/metadataeditor'], function (metadataeditor) {
|
||||
|
||||
metadataeditor.show(itemId).then(getResolveFunction(resolve, id, true), getResolveFunction(resolve, id));
|
||||
});
|
||||
editItem(apiClient, item).then(getResolveFunction(resolve, id, true), getResolveFunction(resolve, id));
|
||||
break;
|
||||
}
|
||||
case 'editimages':
|
||||
|
@ -283,28 +294,27 @@ define(['apphost', 'globalize', 'connectionManager', 'itemHelper', 'embyRouter',
|
|||
}
|
||||
case 'play':
|
||||
{
|
||||
playbackManager.play({
|
||||
items: [item]
|
||||
});
|
||||
play(item, false);
|
||||
getResolveFunction(resolve, id)();
|
||||
break;
|
||||
}
|
||||
case 'resume':
|
||||
{
|
||||
playbackManager.play({
|
||||
items: [item]
|
||||
});
|
||||
play(item, true);
|
||||
getResolveFunction(resolve, id)();
|
||||
break;
|
||||
}
|
||||
case 'queue':
|
||||
{
|
||||
playbackManager.queue({
|
||||
items: [item]
|
||||
});
|
||||
play(item, false, true);
|
||||
getResolveFunction(resolve, id)();
|
||||
break;
|
||||
}
|
||||
case 'record':
|
||||
require(['recordingCreator'], function (recordingCreator) {
|
||||
recordingCreator.show(itemId, serverId).then(getResolveFunction(resolve, id, true), getResolveFunction(resolve, id));
|
||||
});
|
||||
break;
|
||||
case 'shuffle':
|
||||
{
|
||||
playbackManager.shuffle(item);
|
||||
|
@ -375,6 +385,40 @@ define(['apphost', 'globalize', 'connectionManager', 'itemHelper', 'embyRouter',
|
|||
});
|
||||
}
|
||||
|
||||
function play(item, resume, queue) {
|
||||
|
||||
var method = queue ? 'queue' : 'play';
|
||||
|
||||
if (item.Type == 'Program') {
|
||||
playbackManager[method]({
|
||||
ids: [item.ChannelId]
|
||||
});
|
||||
} else {
|
||||
playbackManager[method]({
|
||||
items: [item]
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
function editItem(apiClient, item) {
|
||||
|
||||
return new Promise(function (resolve, reject) {
|
||||
|
||||
if (item.Type == 'Timer') {
|
||||
require(['recordingEditor'], function (recordingEditor) {
|
||||
|
||||
var serverId = apiClient.serverInfo().Id;
|
||||
recordingEditor.show(item.Id, serverId).then(resolve, reject);
|
||||
});
|
||||
} else {
|
||||
require(['components/metadataeditor/metadataeditor'], function (metadataeditor) {
|
||||
|
||||
metadataeditor.show(item.Id).then(resolve, reject);
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function deleteItem(apiClient, itemId) {
|
||||
|
||||
return new Promise(function (resolve, reject) {
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
define([], function () {
|
||||
define(['apphost'], function (appHost) {
|
||||
|
||||
function getDisplayName(item, options) {
|
||||
|
||||
|
@ -49,6 +49,11 @@ define([], function () {
|
|||
}
|
||||
|
||||
function supportsAddingToCollection(item) {
|
||||
|
||||
if (item.Type == 'Timer') {
|
||||
return false;
|
||||
}
|
||||
|
||||
var invalidTypes = ['Person', 'Genre', 'MusicGenre', 'Studio', 'GameGenre', 'BoxSet', 'Playlist', 'UserView', 'CollectionFolder', 'Audio', 'TvChannel', 'Program', 'MusicAlbum', 'Timer'];
|
||||
|
||||
return !item.CollectionType && invalidTypes.indexOf(item.Type) == -1 && item.MediaType != 'Photo';
|
||||
|
@ -92,7 +97,7 @@ define([], function () {
|
|||
|
||||
canEdit: function (user, itemType) {
|
||||
|
||||
if (itemType == "UserRootFolder" || /*itemType == "CollectionFolder" ||*/ itemType == "UserView" || itemType == 'Timer') {
|
||||
if (itemType == "UserRootFolder" || /*itemType == "CollectionFolder" ||*/ itemType == "UserView") {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -111,6 +116,14 @@ define([], function () {
|
|||
}
|
||||
|
||||
return item.SupportsSync;
|
||||
},
|
||||
|
||||
canShare: function (user, item) {
|
||||
|
||||
if (item.Type == 'Timer') {
|
||||
return false;
|
||||
}
|
||||
return user.Policy.EnablePublicSharing && appHost.supports('sharing');
|
||||
}
|
||||
};
|
||||
});
|
|
@ -134,7 +134,10 @@
|
|||
dlg.addEventListener('close', function () {
|
||||
|
||||
if (recordingUpdated) {
|
||||
resolve();
|
||||
resolve({
|
||||
updated: true,
|
||||
deleted: false
|
||||
});
|
||||
} else {
|
||||
reject();
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue