mirror of
https://github.com/Tzahi12345/YoutubeDL-Material.git
synced 2026-04-09 08:21:29 +03:00
Added ability to favorite a file
Moved file filter options above the list of files, and added option to filter for favorites
This commit is contained in:
@@ -21,6 +21,11 @@
|
||||
</mat-menu>
|
||||
<mat-menu #action_menu="matMenu">
|
||||
<ng-container *ngIf="!is_playlist && !loading">
|
||||
<button (click)="emitToggleFavorite()" mat-menu-item>
|
||||
<mat-icon>{{file_obj.favorite ? 'favorite_filled' : 'favorite_outline'}}</mat-icon>
|
||||
<ng-container *ngIf="!file_obj.favorite" i18n="Favorite button">Favorite</ng-container>
|
||||
<ng-container *ngIf="file_obj.favorite" i18n="Unfavorite button">Unfavorite</ng-container>
|
||||
</button>
|
||||
<button (click)="openFileInfoDialog()" mat-menu-item><mat-icon>info</mat-icon><ng-container i18n="Video info button">Info</ng-container></button>
|
||||
<button (click)="navigateToSubscription()" mat-menu-item *ngIf="file_obj.sub_id"><mat-icon>{{file_obj.isAudio ? 'library_music' : 'video_library'}}</mat-icon> <ng-container i18n="Go to subscription menu item">Go to subscription</ng-container></button>
|
||||
<button [disabled]="!availablePlaylists || availablePlaylists.length === 0" [matMenuTriggerFor]="addtoplaylist" mat-menu-item><mat-icon>playlist_add</mat-icon> <ng-container i18n="Add to playlist menu item">Add to playlist</ng-container></button>
|
||||
|
||||
@@ -21,12 +21,15 @@
|
||||
|
||||
.menuButton {
|
||||
right: 0px;
|
||||
width: 40px !important;
|
||||
height: 40px !important;
|
||||
width: 32px !important;
|
||||
height: 32px !important;
|
||||
position: absolute;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
z-index: 999;
|
||||
justify-content: center;
|
||||
padding: 0px !important;
|
||||
top: 2px;
|
||||
}
|
||||
|
||||
/* Coerce the <span> icon container away from display:inline */
|
||||
|
||||
@@ -9,6 +9,7 @@ import localeES from '@angular/common/locales/es';
|
||||
import localeDE from '@angular/common/locales/de';
|
||||
import localeZH from '@angular/common/locales/zh';
|
||||
import localeNB from '@angular/common/locales/nb';
|
||||
import { DatabaseFile } from 'api-types';
|
||||
|
||||
registerLocaleData(localeGB);
|
||||
registerLocaleData(localeFR);
|
||||
@@ -50,6 +51,7 @@ export class UnifiedFileCardComponent implements OnInit {
|
||||
@Input() jwtString = null;
|
||||
@Input() availablePlaylists = null;
|
||||
@Output() goToFile = new EventEmitter<any>();
|
||||
@Output() toggleFavorite = new EventEmitter<DatabaseFile>();
|
||||
@Output() goToSubscription = new EventEmitter<any>();
|
||||
@Output() deleteFile = new EventEmitter<any>();
|
||||
@Output() addFileToPlaylist = new EventEmitter<any>();
|
||||
@@ -158,6 +160,10 @@ export class UnifiedFileCardComponent implements OnInit {
|
||||
this.hide_image = false;
|
||||
}
|
||||
|
||||
emitToggleFavorite() {
|
||||
this.toggleFavorite.emit(this.file_obj);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
function fancyTimeFormat(time) {
|
||||
|
||||
Reference in New Issue
Block a user