mirror of
https://github.com/Tzahi12345/YoutubeDL-Material.git
synced 2026-04-10 02:21:29 +03:00
Fixed bug that resulted in the "download videos in the last X days" timerange in edit subscriptions to come up blank
This commit is contained in:
@@ -39,16 +39,12 @@ export class EditSubscriptionDialogComponent implements OnInit {
|
|||||||
|
|
||||||
if (this.sub.timerange) {
|
if (this.sub.timerange) {
|
||||||
const timerange_str = this.sub.timerange.split('-')[1];
|
const timerange_str = this.sub.timerange.split('-')[1];
|
||||||
console.log(timerange_str);
|
|
||||||
const number = timerange_str.replace(/\D/g,'');
|
const number = timerange_str.replace(/\D/g,'');
|
||||||
let units = timerange_str.replace(/[0-9]/g, '');
|
let units = timerange_str.replace(/[0-9]/g, '');
|
||||||
|
|
||||||
console.log(units);
|
if (+number === 1) {
|
||||||
|
units = units.replace('s', '');
|
||||||
// // remove plural on units
|
}
|
||||||
// if (units[units.length-1] === 's') {
|
|
||||||
// units = units.substring(0, units.length-1);
|
|
||||||
// }
|
|
||||||
|
|
||||||
this.timerange_amount = parseInt(number);
|
this.timerange_amount = parseInt(number);
|
||||||
this.timerange_unit = units;
|
this.timerange_unit = units;
|
||||||
@@ -86,12 +82,16 @@ export class EditSubscriptionDialogComponent implements OnInit {
|
|||||||
}
|
}
|
||||||
|
|
||||||
timerangeChanged(value, select_changed) {
|
timerangeChanged(value, select_changed) {
|
||||||
console.log(this.timerange_amount);
|
if (+this.timerange_amount === 1) {
|
||||||
console.log(this.timerange_unit);
|
this.timerange_unit = this.timerange_unit.replace('s', '');
|
||||||
|
} else {
|
||||||
|
if (!this.timerange_unit.includes('s')) {
|
||||||
|
this.timerange_unit += 's';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (this.timerange_amount && this.timerange_unit && !this.download_all) {
|
if (this.timerange_amount && this.timerange_unit && !this.download_all) {
|
||||||
this.new_sub.timerange = 'now-' + this.timerange_amount.toString() + this.timerange_unit;
|
this.new_sub.timerange = 'now-' + this.timerange_amount.toString() + this.timerange_unit;
|
||||||
console.log(this.new_sub.timerange);
|
|
||||||
} else {
|
} else {
|
||||||
this.new_sub.timerange = null;
|
this.new_sub.timerange = null;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user