mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
update components
This commit is contained in:
parent
fac1b1d5f9
commit
4d0cb27c9b
8 changed files with 59 additions and 16 deletions
|
@ -121,13 +121,16 @@ define(['playbackManager', 'inputManager', 'connectionManager', 'embyRouter', 'g
|
|||
|
||||
var apiClient = connectionManager.getApiClient(serverId);
|
||||
|
||||
if (seriesTimerId) {
|
||||
// cancel all
|
||||
if (seriesTimerId && timerId) {
|
||||
|
||||
// cancel
|
||||
cancelTimer(apiClient, timerId, true);
|
||||
|
||||
} else if (timerId) {
|
||||
|
||||
// change to series recording, if possible
|
||||
// otherwise cancel individual recording
|
||||
changeRecordingToSeries(apiClient, timerId, id);
|
||||
|
||||
} else if (type == 'Program') {
|
||||
// schedule recording
|
||||
|
@ -135,6 +138,42 @@ define(['playbackManager', 'inputManager', 'connectionManager', 'embyRouter', 'g
|
|||
}
|
||||
}
|
||||
|
||||
function changeRecordingToSeries(apiClient, timerId, programId) {
|
||||
|
||||
loading.show();
|
||||
|
||||
apiClient.getItem(apiClient.getCurrentUserId(), programId).then(function (item) {
|
||||
|
||||
if (item.IsSeries) {
|
||||
// cancel, then create series
|
||||
cancelTimer(apiClient, timerId, false).then(function () {
|
||||
apiClient.getNewLiveTvTimerDefaults({ programId: programId }).then(function (timerDefaults) {
|
||||
|
||||
apiClient.createLiveTvSeriesTimer(timerDefaults).then(function () {
|
||||
|
||||
loading.hide();
|
||||
sendToast(globalize.translate('sharedcomponents#SeriesRecordingScheduled'));
|
||||
});
|
||||
});
|
||||
});
|
||||
} else {
|
||||
// cancel
|
||||
cancelTimer(apiClient, timerId, true);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function cancelTimer(apiClient, timerId, hideLoading) {
|
||||
loading.show();
|
||||
return apiClient.cancelLiveTvTimer(timerId).then(function () {
|
||||
|
||||
if (hideLoading) {
|
||||
loading.hide();
|
||||
sendToast(globalize.translate('sharedcomponents#RecordingCancelled'));
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function createRecording(apiClient, programId) {
|
||||
|
||||
loading.show();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue