mirror of
https://github.com/Tzahi12345/YoutubeDL-Material.git
synced 2026-04-28 11:23:20 +03:00
Updated new home page UI to support file manager disabling and permissions
- file manager enabled state is now cached for faster loading
This commit is contained in:
@@ -181,10 +181,12 @@
|
|||||||
|
|
||||||
</ng-template>
|
</ng-template>
|
||||||
|
|
||||||
<app-recent-videos></app-recent-videos>
|
<ng-container *ngIf="cachedFileManagerEnabled || fileManagerEnabled">
|
||||||
<br/>
|
<app-recent-videos></app-recent-videos>
|
||||||
<h4 style="text-align: center">Custom playlists</h4>
|
<br/>
|
||||||
<app-custom-playlists></app-custom-playlists>
|
<h4 style="text-align: center">Custom playlists</h4>
|
||||||
|
<app-custom-playlists></app-custom-playlists>
|
||||||
|
</ng-container>
|
||||||
|
|
||||||
<!--<div style="margin: 20px" *ngIf="fileManagerEnabled && (!postsService.isLoggedIn || postsService.permissions.includes('filemanager'))">
|
<!--<div style="margin: 20px" *ngIf="fileManagerEnabled && (!postsService.isLoggedIn || postsService.permissions.includes('filemanager'))">
|
||||||
<mat-accordion>
|
<mat-accordion>
|
||||||
|
|||||||
@@ -82,8 +82,9 @@ export class MainComponent implements OnInit {
|
|||||||
useDefaultDownloadingAgent = true;
|
useDefaultDownloadingAgent = true;
|
||||||
customDownloadingAgent = null;
|
customDownloadingAgent = null;
|
||||||
|
|
||||||
// formats cache
|
// cache
|
||||||
cachedAvailableFormats = {};
|
cachedAvailableFormats = {};
|
||||||
|
cachedFileManagerEnabled = localStorage.getItem('cached_filemanager_enabled') === 'true';
|
||||||
|
|
||||||
// youtube api
|
// youtube api
|
||||||
youtubeSearchEnabled = false;
|
youtubeSearchEnabled = false;
|
||||||
@@ -232,7 +233,8 @@ export class MainComponent implements OnInit {
|
|||||||
|
|
||||||
async loadConfig() {
|
async loadConfig() {
|
||||||
// loading config
|
// loading config
|
||||||
this.fileManagerEnabled = this.postsService.config['Extra']['file_manager_enabled'];
|
this.fileManagerEnabled = this.postsService.config['Extra']['file_manager_enabled']
|
||||||
|
&& (!this.postsService.isLoggedIn || this.postsService.permissions.includes('filemanager'));
|
||||||
this.downloadOnlyMode = this.postsService.config['Extra']['download_only_mode'];
|
this.downloadOnlyMode = this.postsService.config['Extra']['download_only_mode'];
|
||||||
this.allowMultiDownloadMode = this.postsService.config['Extra']['allow_multi_download_mode'];
|
this.allowMultiDownloadMode = this.postsService.config['Extra']['allow_multi_download_mode'];
|
||||||
this.audioFolderPath = this.postsService.config['Downloader']['path-audio'];
|
this.audioFolderPath = this.postsService.config['Downloader']['path-audio'];
|
||||||
@@ -261,6 +263,10 @@ export class MainComponent implements OnInit {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// set final cache items
|
// set final cache items
|
||||||
|
|
||||||
|
localStorage.setItem('cached_filemanager_enabled', this.fileManagerEnabled.toString());
|
||||||
|
this.cachedFileManagerEnabled = this.fileManagerEnabled;
|
||||||
|
|
||||||
if (this.allowAdvancedDownload) {
|
if (this.allowAdvancedDownload) {
|
||||||
if (localStorage.getItem('customArgsEnabled') !== null) {
|
if (localStorage.getItem('customArgsEnabled') !== null) {
|
||||||
this.customArgsEnabled = localStorage.getItem('customArgsEnabled') === 'true';
|
this.customArgsEnabled = localStorage.getItem('customArgsEnabled') === 'true';
|
||||||
|
|||||||
Reference in New Issue
Block a user