mirror of
https://github.com/Tzahi12345/YoutubeDL-Material.git
synced 2026-03-18 18:50:58 +03:00
UI & logs now use proper fork name rather than just youtube-dl
This commit is contained in:
@@ -4,6 +4,7 @@
|
||||
|
||||
export type Task = {
|
||||
key: string;
|
||||
title?: string;
|
||||
last_ran: number;
|
||||
last_confirmed: number;
|
||||
running: boolean;
|
||||
|
||||
@@ -7,6 +7,7 @@ import { ConfirmDialogComponent } from 'app/dialogs/confirm-dialog/confirm-dialo
|
||||
import { RestoreDbDialogComponent } from 'app/dialogs/restore-db-dialog/restore-db-dialog.component';
|
||||
import { UpdateTaskScheduleDialogComponent } from 'app/dialogs/update-task-schedule-dialog/update-task-schedule-dialog.component';
|
||||
import { PostsService } from 'app/posts.services';
|
||||
import { Task } from 'api-types';
|
||||
|
||||
@Component({
|
||||
selector: 'app-tasks',
|
||||
@@ -17,7 +18,7 @@ export class TasksComponent implements OnInit {
|
||||
|
||||
interval_id = null;
|
||||
tasks_check_interval = 1500;
|
||||
tasks = null;
|
||||
tasks: Task[] = null;
|
||||
tasks_retrieved = false;
|
||||
|
||||
displayedColumns: string[] = ['title', 'last_ran', 'last_confirmed', 'status', 'actions'];
|
||||
@@ -55,6 +56,11 @@ export class TasksComponent implements OnInit {
|
||||
|
||||
getTasks(): void {
|
||||
this.postsService.getTasks().subscribe(res => {
|
||||
for (const task of res['tasks']) {
|
||||
if (task.title.includes('youtube-dl')) {
|
||||
task.title = task.title.replace('youtube-dl', this.postsService.config.Advanced.default_downloader);
|
||||
}
|
||||
}
|
||||
if (this.tasks) {
|
||||
if (JSON.stringify(this.tasks) === JSON.stringify(res['tasks'])) return;
|
||||
for (const task of res['tasks']) {
|
||||
@@ -94,7 +100,7 @@ export class TasksComponent implements OnInit {
|
||||
});
|
||||
}
|
||||
|
||||
scheduleTask(task: any): void {
|
||||
scheduleTask(task: Task): void {
|
||||
// open dialog
|
||||
const dialogRef = this.dialog.open(UpdateTaskScheduleDialogComponent, {
|
||||
data: {
|
||||
@@ -152,13 +158,3 @@ export class TasksComponent implements OnInit {
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
export interface Task {
|
||||
key: string;
|
||||
title: string;
|
||||
last_ran: number;
|
||||
last_confirmed: number;
|
||||
running: boolean;
|
||||
confirming: boolean;
|
||||
data: unknown;
|
||||
}
|
||||
@@ -591,7 +591,8 @@ export class MainComponent implements OnInit {
|
||||
if (passwordIndex !== -1 && passwordIndex !== simulated_args.length - 1) {
|
||||
simulated_args[passwordIndex + 1] = simulated_args[passwordIndex + 1].replace(/./g, '*');
|
||||
}
|
||||
this.simulatedOutput = `youtube-dl ${this.url} ${simulated_args.join(' ')}`;
|
||||
const downloader = this.postsService.config.Advanced.default_downloader;
|
||||
this.simulatedOutput = `${downloader} ${this.url} ${simulated_args.join(' ')}`;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@@ -100,7 +100,8 @@ import {
|
||||
UpdateFileRequest,
|
||||
Sort,
|
||||
FileTypeFilter,
|
||||
GetAllFilesRequest
|
||||
GetAllFilesRequest,
|
||||
GetAllTasksResponse
|
||||
} from '../api-types';
|
||||
import { isoLangs } from './settings/locales_list';
|
||||
import { Title } from '@angular/platform-browser';
|
||||
@@ -596,7 +597,7 @@ export class PostsService implements CanActivate {
|
||||
}
|
||||
|
||||
getTasks() {
|
||||
return this.http.post<SuccessObject>(this.path + 'getTasks', {}, this.httpOptions);
|
||||
return this.http.post<GetAllTasksResponse>(this.path + 'getTasks', {}, this.httpOptions);
|
||||
}
|
||||
|
||||
resetTasks() {
|
||||
|
||||
Reference in New Issue
Block a user