mirror of
https://github.com/Tzahi12345/YoutubeDL-Material.git
synced 2026-03-18 10:40:57 +03:00
Updated video playing/sharing logic to support sharing of playlists in multi user mode and when multi user mode is disabled
Fixed bug that caused normal archive to be used in multi-user mode Updated login logic when username is not found or user file is missing Fixed bug that prevented playlist sharing from working Added ability to use timestamps when sharing videos
This commit is contained in:
@@ -9,6 +9,12 @@
|
||||
<div>
|
||||
<mat-checkbox [checked]="sharing_enabled" (change)="sharingChanged($event)"><ng-container i18n="Enable sharing checkbox">Enable sharing</ng-container></mat-checkbox>
|
||||
</div>
|
||||
<div>
|
||||
<mat-checkbox style="margin-right: 15px;" (change)="useTimestampChanged()" [(ngModel)]="timestamp_enabled">Use timestamp</mat-checkbox>
|
||||
<mat-form-field>
|
||||
<input matInput type="number" [(ngModel)]="current_timestamp" [disabled]="!timestamp_enabled" (change)="timestampInputChanged($event)" placeholder="Seconds" i18n-placeholder="Seconds">
|
||||
</mat-form-field>
|
||||
</div>
|
||||
<div>
|
||||
<mat-form-field style="width: 100%">
|
||||
<input matInput [disabled]="!sharing_enabled" [readonly]="true" [value]="share_url">
|
||||
|
||||
@@ -15,8 +15,11 @@ export class ShareMediaDialogComponent implements OnInit {
|
||||
uid = null;
|
||||
uuid = null;
|
||||
share_url = null;
|
||||
default_share_url = null;
|
||||
sharing_enabled = null;
|
||||
is_playlist = null;
|
||||
current_timestamp = null
|
||||
timestamp_enabled = false;
|
||||
|
||||
constructor(@Inject(MAT_DIALOG_DATA) public data: any, public router: Router, private snackBar: MatSnackBar,
|
||||
private postsService: PostsService) { }
|
||||
@@ -28,15 +31,34 @@ export class ShareMediaDialogComponent implements OnInit {
|
||||
this.uuid = this.data.uuid;
|
||||
this.sharing_enabled = this.data.sharing_enabled;
|
||||
this.is_playlist = this.data.is_playlist;
|
||||
this.current_timestamp = (this.data.current_timestamp / 1000).toFixed(2);
|
||||
|
||||
const arg = (this.is_playlist ? ';id=' : ';uid=');
|
||||
this.share_url = window.location.href.split(';')[0] + arg + this.uid;
|
||||
this.default_share_url = window.location.href.split(';')[0] + arg + this.uid;
|
||||
if (this.uuid) {
|
||||
this.share_url += ';uuid=' + this.uuid;
|
||||
this.default_share_url += ';uuid=' + this.uuid;
|
||||
}
|
||||
this.share_url = this.default_share_url;
|
||||
}
|
||||
}
|
||||
|
||||
timestampInputChanged(change) {
|
||||
if (!this.timestamp_enabled) {
|
||||
this.share_url = this.default_share_url;
|
||||
return;
|
||||
}
|
||||
const new_val = change.target.value;
|
||||
if (new_val > 0) {
|
||||
this.share_url = this.default_share_url + ';timestamp=' + new_val;
|
||||
} else {
|
||||
this.share_url = this.default_share_url;
|
||||
}
|
||||
}
|
||||
|
||||
useTimestampChanged() {
|
||||
this.timestampInputChanged({target: {value: this.current_timestamp}})
|
||||
}
|
||||
|
||||
copiedToClipboard() {
|
||||
this.openSnackBar('Copied to clipboard!');
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user