mirror of
https://github.com/Tzahi12345/YoutubeDL-Material.git
synced 2026-04-17 10:01:30 +03:00
Added ability to favorite a file
Moved file filter options above the list of files, and added option to filter for favorites
This commit is contained in:
@@ -19,6 +19,7 @@ export class VideoInfoDialogComponent implements OnInit {
|
||||
category: Category;
|
||||
editing = false;
|
||||
initialized = false;
|
||||
retrieving_file = false;
|
||||
|
||||
constructor(@Inject(MAT_DIALOG_DATA) public data: any, public postsService: PostsService, private datePipe: DatePipe) { }
|
||||
|
||||
@@ -58,9 +59,14 @@ export class VideoInfoDialogComponent implements OnInit {
|
||||
}
|
||||
|
||||
getFile(): void {
|
||||
this.retrieving_file = true;
|
||||
this.postsService.getFile(this.file.uid).subscribe(res => {
|
||||
this.retrieving_file = false;
|
||||
this.file = res['file'];
|
||||
this.initializeFile(this.file);
|
||||
}, err => {
|
||||
this.retrieving_file = false;
|
||||
console.error(err);
|
||||
});
|
||||
}
|
||||
|
||||
@@ -85,4 +91,12 @@ export class VideoInfoDialogComponent implements OnInit {
|
||||
return JSON.stringify(this.file) !== JSON.stringify(this.new_file);
|
||||
}
|
||||
|
||||
toggleFavorite(): void {
|
||||
this.file.favorite = !this.file.favorite;
|
||||
this.retrieving_file = true;
|
||||
this.postsService.updateFile(this.file.uid, {favorite: this.file.favorite}).subscribe(res => {
|
||||
this.getFile();
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user