feat: implement file dialog for playlist uploads in FileUploadComponent

This commit is contained in:
4gray committed 2024-12-01 15:00:27 +01:00
1 parent c9a917ef9d
commit d13fa6fa28
4 files changed
+40 -6

No files matched your search

@@ -6,6 +6,7 @@
<app-file-upload
(fileRejected)="rejectFile($event)"
(fileSelected)="handlePlaylist($event)"
(closeDialog)="closeDialog()"
/>
} @else if (playlistType === 'url') {
<app-url-upload (urlAdded)="sendPlaylistsUrl($event)" />
@@ -54,7 +54,6 @@ export class AddPlaylistDialogComponent {
* @param payload
*/
handlePlaylist(payload: { uploadEvent: Event; file: File }): void {
// this.isLoading = true;
const playlist = (payload.uploadEvent.target as FileReader)
.result as string;
@@ -75,7 +74,6 @@ export class AddPlaylistDialogComponent {
filename,
})
);
// this.isLoading = false;
}
/**
@@ -83,7 +81,6 @@ export class AddPlaylistDialogComponent {
* @param playlistUrl url of the added playlist
*/
sendPlaylistsUrl(playlistUrl: string): void {
// this.isLoading = true;
this.dataService.sendIpcEvent(PLAYLIST_PARSE_BY_URL, {
title: getFilenameFromUrl(playlistUrl),
url: playlistUrl,
@@ -96,7 +93,6 @@ export class AddPlaylistDialogComponent {
* @param text playlist as string
*/
uploadAsText(playlist: string): void {
// this.isLoading = true;
this.store.dispatch(
parsePlaylist({
uploadType: 'TEXT',