backup
This commit is contained in:
@@ -206,6 +206,7 @@ class AniWorldApp {
|
||||
this.socket.on('download_started', (data) => {
|
||||
this.isDownloading = true;
|
||||
this.isPaused = false;
|
||||
this.updateProcessStatus('download', true);
|
||||
this.showDownloadQueue(data);
|
||||
this.showStatus(`Starting download of ${data.total_series} series...`, true, true);
|
||||
});
|
||||
@@ -237,6 +238,21 @@ class AniWorldApp {
|
||||
this.showToast(`${this.localization.getText('download-failed')}: ${data.message}`, 'error');
|
||||
});
|
||||
|
||||
// Download queue status events
|
||||
this.socket.on('download_queue_completed', () => {
|
||||
this.updateProcessStatus('download', false);
|
||||
this.showToast('All downloads completed!', 'success');
|
||||
});
|
||||
|
||||
this.socket.on('download_stop_requested', () => {
|
||||
this.showToast('Stopping downloads...', 'info');
|
||||
});
|
||||
|
||||
this.socket.on('download_stopped', () => {
|
||||
this.updateProcessStatus('download', false);
|
||||
this.showToast('Downloads stopped', 'success');
|
||||
});
|
||||
|
||||
// Download queue events
|
||||
this.socket.on('download_queue_update', (data) => {
|
||||
this.updateDownloadQueue(data);
|
||||
@@ -476,7 +492,13 @@ class AniWorldApp {
|
||||
}
|
||||
|
||||
async makeAuthenticatedRequest(url, options = {}) {
|
||||
const response = await fetch(url, options);
|
||||
// Ensure credentials are included for session-based authentication
|
||||
const requestOptions = {
|
||||
credentials: 'same-origin',
|
||||
...options
|
||||
};
|
||||
|
||||
const response = await fetch(url, requestOptions);
|
||||
|
||||
if (response.status === 401) {
|
||||
window.location.href = '/login';
|
||||
|
||||
Reference in New Issue
Block a user