mirror of
https://github.com/Tzahi12345/YoutubeDL-Material.git
synced 2026-04-20 10:23:19 +03:00
Modifying playlist in dialog will now update the file manager automatically
This commit is contained in:
@@ -14,6 +14,7 @@ export class ModifyPlaylistComponent implements OnInit {
|
|||||||
playlist = null;
|
playlist = null;
|
||||||
available_files = [];
|
available_files = [];
|
||||||
all_files = [];
|
all_files = [];
|
||||||
|
playlist_updated = false;
|
||||||
|
|
||||||
constructor(@Inject(MAT_DIALOG_DATA) public data: any,
|
constructor(@Inject(MAT_DIALOG_DATA) public data: any,
|
||||||
private postsService: PostsService,
|
private postsService: PostsService,
|
||||||
@@ -46,6 +47,7 @@ export class ModifyPlaylistComponent implements OnInit {
|
|||||||
|
|
||||||
updatePlaylist() {
|
updatePlaylist() {
|
||||||
this.postsService.updatePlaylist(this.playlist).subscribe(res => {
|
this.postsService.updatePlaylist(this.playlist).subscribe(res => {
|
||||||
|
this.playlist_updated = true;
|
||||||
this.postsService.openSnackBar('Playlist updated successfully.');
|
this.postsService.openSnackBar('Playlist updated successfully.');
|
||||||
this.getPlaylist();
|
this.getPlaylist();
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -88,6 +88,15 @@ export class FileCardComponent implements OnInit {
|
|||||||
width: '65vw'
|
width: '65vw'
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
dialogRef.afterClosed().subscribe(res => {
|
||||||
|
// updates playlist in file manager if it changed
|
||||||
|
if (dialogRef.componentInstance.playlist_updated) {
|
||||||
|
this.playlist = dialogRef.componentInstance.original_playlist;
|
||||||
|
this.title = this.playlist.name;
|
||||||
|
this.count = this.playlist.fileNames.length;
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
onImgError(event) {
|
onImgError(event) {
|
||||||
|
|||||||
Reference in New Issue
Block a user