diff --git a/backend/downloader.js b/backend/downloader.js index e7fb9f3..7fd8703 100644 --- a/backend/downloader.js +++ b/backend/downloader.js @@ -308,7 +308,7 @@ async function downloadQueuedFile(download_uid) { } // renames file if necessary due to bug - if (!fs.existsSync(output_json['_filename'] && fs.existsSync(output_json['_filename'] + '.webm'))) { + if (!fs.existsSync(output_json['_filename']) && fs.existsSync(output_json['_filename'] + '.webm')) { try { fs.renameSync(output_json['_filename'] + '.webm', output_json['_filename']); logger.info('Renamed ' + file_name + '.webm to ' + file_name); diff --git a/src/app/components/downloads/downloads.component.html b/src/app/components/downloads/downloads.component.html index db7d220..e9458f8 100644 --- a/src/app/components/downloads/downloads.component.html +++ b/src/app/components/downloads/downloads.component.html @@ -1,6 +1,6 @@
-
- +
+ @@ -69,22 +69,22 @@ - + -
-
+
-
+

No downloads available!

\ No newline at end of file diff --git a/src/app/components/downloads/downloads.component.scss b/src/app/components/downloads/downloads.component.scss index bb84a6d..ed84df9 100644 --- a/src/app/components/downloads/downloads.component.scss +++ b/src/app/components/downloads/downloads.component.scss @@ -17,4 +17,16 @@ mat-header-cell, mat-cell { .downloads-action-button-div { margin-top: 10px; margin-left: 5px; +} + +.rounded-top { + border-radius: 16px 16px 0px 0px !important; +} + +.rounded-bottom { + border-radius: 0px 0px 16px 16px !important; +} + +.rounded { + border-radius: 16px 16px 16px 16px !important; } \ No newline at end of file diff --git a/src/app/components/downloads/downloads.component.ts b/src/app/components/downloads/downloads.component.ts index 7ff785e..c253130 100644 --- a/src/app/components/downloads/downloads.component.ts +++ b/src/app/components/downloads/downloads.component.ts @@ -1,4 +1,4 @@ -import { Component, OnInit, OnDestroy, ViewChild } from '@angular/core'; +import { Component, OnInit, OnDestroy, ViewChild, Input } from '@angular/core'; import { PostsService } from 'app/posts.services'; import { trigger, transition, animateChild, stagger, query, style, animate } from '@angular/animations'; import { Router } from '@angular/router'; @@ -39,6 +39,8 @@ import { MatSort } from '@angular/material/sort'; }) export class DownloadsComponent implements OnInit, OnDestroy { + @Input() uids = null; + downloads_check_interval = 1000; downloads = []; finished_downloads = []; @@ -100,7 +102,7 @@ export class DownloadsComponent implements OnInit, OnDestroy { } getCurrentDownloads(): void { - this.postsService.getCurrentDownloads().subscribe(res => { + this.postsService.getCurrentDownloads(this.uids).subscribe(res => { this.downloads_retrieved = true; if (res['downloads'] !== null && res['downloads'] !== undefined diff --git a/src/app/components/unified-file-card/unified-file-card.component.ts b/src/app/components/unified-file-card/unified-file-card.component.ts index 9451a9a..205def0 100644 --- a/src/app/components/unified-file-card/unified-file-card.component.ts +++ b/src/app/components/unified-file-card/unified-file-card.component.ts @@ -82,7 +82,7 @@ export class UnifiedFileCardComponent implements OnInit { this.thumbnailBlobURL = this.sanitizer.bypassSecurityTrustUrl(bloburl);*/ } - this.streamURL = this.generateStreamURL(); + if (this.file_obj) this.streamURL = this.generateStreamURL(); } emitDeleteFile(blacklistMode = false) { diff --git a/src/app/main/main.component.html b/src/app/main/main.component.html index 84ae4f7..3bfdc23 100644 --- a/src/app/main/main.component.html +++ b/src/app/main/main.component.html @@ -170,7 +170,7 @@

-
+
@@ -185,9 +185,10 @@

- - +
+ +
diff --git a/src/app/main/main.component.ts b/src/app/main/main.component.ts index cced686..bf56ae8 100644 --- a/src/app/main/main.component.ts +++ b/src/app/main/main.component.ts @@ -95,6 +95,7 @@ export class MainComponent implements OnInit { playlist_thumbnails = {}; downloading_content = {'audio': {}, 'video': {}}; downloads: Download[] = []; + download_uids: string[] = []; current_download: Download = null; urlForm = new FormControl('', [Validators.required]); @@ -430,7 +431,6 @@ export class MainComponent implements OnInit { } const type = this.audioOnly ? 'audio' : 'video'; - this.downloadingfile = true; const customQualityConfiguration = type === 'audio' ? this.getSelectedAudioFormat() : this.getSelectedVideoFormat(); @@ -443,10 +443,12 @@ export class MainComponent implements OnInit { } } + this.downloadingfile = true; this.postsService.downloadFile(this.url, type, (this.selectedQuality === '' ? null : this.selectedQuality), customQualityConfiguration, customArgs, customOutput, youtubeUsername, youtubePassword, cropFileSettings).subscribe(res => { this.current_download = res['download']; - this.downloadingfile = true; + this.downloads.push(res['download']); + this.download_uids.push(res['download']['uid']); }, error => { // can't access server this.downloadingfile = false; this.current_download = null; @@ -454,7 +456,7 @@ export class MainComponent implements OnInit { }); if (!this.autoplay) { - const download_queued_message = $localize`Download for ${this.url}:url has been queued!`; + const download_queued_message = $localize`Download for ${this.url}:url: has been queued!`; this.postsService.openSnackBar(download_queued_message); this.url = ''; this.downloadingfile = false;