fix: less strict url validation of playlist URL

closes #22
This commit is contained in:
4gray committed 2021-02-27 13:39:51 +01:00
1 parent e29f09d18c
commit 4f366d91fd
2 files changed
+6 -3

No files matched your search

+5 -2
View File
@@ -44,10 +44,12 @@ export class HomeComponent {
}, },
{ {
id: 'error', id: 'error',
execute: (response: { message: string; status: number }) => execute: (response: { message: string; status: number }) => {
this.isLoading = false;
this.showNotification( this.showNotification(
`Error: ${response.status} ${response.message}. Please check the entered playlist URL again.` `Error: ${response.status} ${response.message}. Please check the entered playlist URL again.`
), );
},
}, },
]; ];
@@ -124,6 +126,7 @@ export class HomeComponent {
* @param playlistUrl url of the added playlist * @param playlistUrl url of the added playlist
*/ */
sendPlaylistsUrl(playlistUrl: string): void { sendPlaylistsUrl(playlistUrl: string): void {
this.isLoading = true;
this.electronService.ipcRenderer.send('parse-playlist-by-url', { this.electronService.ipcRenderer.send('parse-playlist-by-url', {
title: this.getLastUrlSegment(playlistUrl), title: this.getLastUrlSegment(playlistUrl),
url: playlistUrl, url: playlistUrl,
@@ -20,7 +20,7 @@ export class UrlUploadComponent implements OnInit {
constructor(private fb: FormBuilder) {} constructor(private fb: FormBuilder) {}
ngOnInit(): void { ngOnInit(): void {
const urlRegex = '(https?://.*?.(m3u|m3u8))'; const urlRegex = '(https?://.*?)';
this.form = this.fb.group({ this.form = this.fb.group({
playlistUrl: [ playlistUrl: [
'', '',