mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
update dialogs
This commit is contained in:
parent
b385aa2d95
commit
797ab3899b
23 changed files with 469 additions and 95 deletions
|
@ -1,4 +1,4 @@
|
|||
define(['playbackManager', 'inputManager', 'connectionManager', 'embyRouter'], function (playbackManager, inputManager, connectionManager, embyRouter) {
|
||||
define(['playbackManager', 'inputManager', 'connectionManager', 'embyRouter', 'globalize', 'loading'], function (playbackManager, inputManager, connectionManager, embyRouter, globalize, loading) {
|
||||
|
||||
function playAllFromHere(card, serverId) {
|
||||
var cards = card.parentNode.querySelectorAll('.itemAction[data-id]');
|
||||
|
@ -111,6 +111,47 @@ define(['playbackManager', 'inputManager', 'connectionManager', 'embyRouter'], f
|
|||
else if (action == 'setplaylistindex') {
|
||||
|
||||
}
|
||||
|
||||
else if (action == 'record') {
|
||||
onRecordCommand(serverId, id, type, card.getAttribute('data-timerid'), card.getAttribute('data-seriestimerid'));
|
||||
}
|
||||
}
|
||||
|
||||
function onRecordCommand(serverId, id, type, timerId, seriesTimerId) {
|
||||
|
||||
var apiClient = connectionManager.getApiClient(serverId);
|
||||
|
||||
if (seriesTimerId) {
|
||||
// cancel all
|
||||
|
||||
} else if (timerId) {
|
||||
|
||||
// change to series recording, if possible
|
||||
// otherwise cancel individual recording
|
||||
|
||||
} else if (type == 'Program') {
|
||||
// schedule recording
|
||||
createRecording(apiClient, id);
|
||||
}
|
||||
}
|
||||
|
||||
function createRecording(apiClient, programId) {
|
||||
|
||||
loading.show();
|
||||
apiClient.getNewLiveTvTimerDefaults({ programId: programId }).then(function (item) {
|
||||
|
||||
apiClient.createLiveTvTimer(item).then(function () {
|
||||
|
||||
loading.hide();
|
||||
sendToast(globalize.translate('sharedcomponents#RecordingScheduled'));
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
function sendToast(msg) {
|
||||
require(['toast'], function (toast) {
|
||||
toast(msg);
|
||||
});
|
||||
}
|
||||
|
||||
function onClick(e) {
|
||||
|
@ -141,7 +182,7 @@ define(['playbackManager', 'inputManager', 'connectionManager', 'embyRouter'], f
|
|||
function onCommand(e) {
|
||||
var cmd = e.detail.command;
|
||||
|
||||
if (cmd == 'play') {
|
||||
if (cmd == 'play' || cmd == 'record') {
|
||||
var card = parentWithClass(e.target, 'itemAction');
|
||||
|
||||
if (card) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue