mirror of
https://github.com/Tzahi12345/YoutubeDL-Material.git
synced 2026-04-10 14:31:28 +03:00
Refactored player component to utilize uids instead of fileNames to improve maintainability, consistency, and reliability
Playlists now use uids instead of fileNames Added generic getPlaylist and updatePlaylist functions
This commit is contained in:
@@ -42,7 +42,7 @@ export class SubscriptionFileCardComponent implements OnInit {
|
||||
|
||||
goToFile() {
|
||||
const emit_obj = {
|
||||
name: this.file.id,
|
||||
uid: this.file.uid,
|
||||
url: this.file.requested_formats ? this.file.requested_formats[0].url : this.file.url
|
||||
}
|
||||
this.goToFileEmit.emit(emit_obj);
|
||||
|
||||
@@ -103,15 +103,14 @@ export class SubscriptionComponent implements OnInit, OnDestroy {
|
||||
}
|
||||
|
||||
goToFile(emit_obj) {
|
||||
const name = emit_obj['name'];
|
||||
const uid = emit_obj['uid'];
|
||||
const url = emit_obj['url'];
|
||||
localStorage.setItem('player_navigator', this.router.url);
|
||||
if (this.subscription.streamingOnly) {
|
||||
this.router.navigate(['/player', {name: name, url: url}]);
|
||||
this.router.navigate(['/player', {uid: uid, url: url}]);
|
||||
} else {
|
||||
this.router.navigate(['/player', {fileNames: name,
|
||||
type: this.subscription.type ? this.subscription.type : 'video', subscriptionName: this.subscription.name,
|
||||
subPlaylist: this.subscription.isPlaylist}]);
|
||||
this.router.navigate(['/player', {uid: uid,
|
||||
sub_id: this.subscription.id}]);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -154,14 +153,15 @@ export class SubscriptionComponent implements OnInit, OnDestroy {
|
||||
}
|
||||
|
||||
this.downloading = true;
|
||||
this.postsService.downloadFileFromServer(fileNames, 'video', this.subscription.name, true).subscribe(res => {
|
||||
// TODO: add download subscription route
|
||||
/*this.postsService.downloadFileFromServer(fileNames, 'video', this.subscription.name, true).subscribe(res => {
|
||||
this.downloading = false;
|
||||
const blob: Blob = res;
|
||||
saveAs(blob, this.subscription.name + '.zip');
|
||||
}, err => {
|
||||
console.log(err);
|
||||
this.downloading = false;
|
||||
});
|
||||
});*/
|
||||
}
|
||||
|
||||
editSubscription() {
|
||||
|
||||
Reference in New Issue
Block a user