Multi download mode and download-only mode now reloads recent videos

This commit is contained in:
Isaac Abadi
2020-11-24 03:38:49 -05:00
parent cc78091403
commit 09832ad15b
2 changed files with 13 additions and 1 deletions

View File

@@ -182,7 +182,7 @@
</ng-template> </ng-template>
<ng-container *ngIf="cachedFileManagerEnabled || fileManagerEnabled"> <ng-container *ngIf="cachedFileManagerEnabled || fileManagerEnabled">
<app-recent-videos></app-recent-videos> <app-recent-videos #recentVideos></app-recent-videos>
<br/> <br/>
<h4 style="text-align: center">Custom playlists</h4> <h4 style="text-align: center">Custom playlists</h4>
<app-custom-playlists></app-custom-playlists> <app-custom-playlists></app-custom-playlists>

View File

@@ -20,6 +20,7 @@ import { CreatePlaylistComponent } from 'app/create-playlist/create-playlist.com
import { Platform } from '@angular/cdk/platform'; import { Platform } from '@angular/cdk/platform';
import { v4 as uuid } from 'uuid'; import { v4 as uuid } from 'uuid';
import { ArgModifierDialogComponent } from 'app/dialogs/arg-modifier-dialog/arg-modifier-dialog.component'; import { ArgModifierDialogComponent } from 'app/dialogs/arg-modifier-dialog/arg-modifier-dialog.component';
import { RecentVideosComponent } from 'app/components/recent-videos/recent-videos.component';
export let audioFilesMouseHovering = false; export let audioFilesMouseHovering = false;
export let videoFilesMouseHovering = false; export let videoFilesMouseHovering = false;
@@ -200,6 +201,7 @@ export class MainComponent implements OnInit {
formats_loading = false; formats_loading = false;
@ViewChild('urlinput', { read: ElementRef }) urlInput: ElementRef; @ViewChild('urlinput', { read: ElementRef }) urlInput: ElementRef;
@ViewChild('recentVideos') recentVideos: RecentVideosComponent;
@ViewChildren('audiofilecard') audioFileCards: QueryList<FileCardComponent>; @ViewChildren('audiofilecard') audioFileCards: QueryList<FileCardComponent>;
@ViewChildren('videofilecard') videoFileCards: QueryList<FileCardComponent>; @ViewChildren('videofilecard') videoFileCards: QueryList<FileCardComponent>;
last_valid_url = ''; last_valid_url = '';
@@ -487,6 +489,7 @@ export class MainComponent implements OnInit {
this.downloadingfile = false; this.downloadingfile = false;
if (this.multiDownloadMode && !this.downloadOnlyMode && !navigate_mode) { if (this.multiDownloadMode && !this.downloadOnlyMode && !navigate_mode) {
// do nothing // do nothing
this.reloadRecentVideos();
} else { } else {
// if download only mode, just download the file. no redirect // if download only mode, just download the file. no redirect
if (forceView === false && this.downloadOnlyMode && !this.iOS) { if (forceView === false && this.downloadOnlyMode && !this.iOS) {
@@ -496,6 +499,7 @@ export class MainComponent implements OnInit {
} else { } else {
this.downloadAudioFile(decodeURI(name)); this.downloadAudioFile(decodeURI(name));
} }
this.reloadRecentVideos();
} else { } else {
localStorage.setItem('player_navigator', this.router.url.split(';')[0]); localStorage.setItem('player_navigator', this.router.url.split(';')[0]);
if (is_playlist) { if (is_playlist) {
@@ -524,6 +528,7 @@ export class MainComponent implements OnInit {
this.downloadingfile = false; this.downloadingfile = false;
if (this.multiDownloadMode && !this.downloadOnlyMode && !navigate_mode) { if (this.multiDownloadMode && !this.downloadOnlyMode && !navigate_mode) {
// do nothing // do nothing
this.reloadRecentVideos();
} else { } else {
// if download only mode, just download the file. no redirect // if download only mode, just download the file. no redirect
if (forceView === false && this.downloadOnlyMode) { if (forceView === false && this.downloadOnlyMode) {
@@ -533,6 +538,7 @@ export class MainComponent implements OnInit {
} else { } else {
this.downloadVideoFile(decodeURI(name)); this.downloadVideoFile(decodeURI(name));
} }
this.reloadRecentVideos();
} else { } else {
localStorage.setItem('player_navigator', this.router.url.split(';')[0]); localStorage.setItem('player_navigator', this.router.url.split(';')[0]);
if (is_playlist) { if (is_playlist) {
@@ -1161,4 +1167,10 @@ export class MainComponent implements OnInit {
} }
}); });
} }
reloadRecentVideos() {
if (this.recentVideos) {
this.recentVideos.getAllFiles();
}
}
} }