Skip to content

Commit

Permalink
fix: less strict url validation of playlist URL
Browse files Browse the repository at this point in the history
closes #22
  • Loading branch information
4gray committed Feb 27, 2021
1 parent e29f09d commit 4f366d9
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
7 changes: 5 additions & 2 deletions src/app/home/home.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,12 @@ export class HomeComponent {
},
{
id: 'error',
execute: (response: { message: string; status: number }) =>
execute: (response: { message: string; status: number }) => {
this.isLoading = false;
this.showNotification(
`Error: ${response.status} ${response.message}. Please check the entered playlist URL again.`
),
);
},
},
];

Expand Down Expand Up @@ -124,6 +126,7 @@ export class HomeComponent {
* @param playlistUrl url of the added playlist
*/
sendPlaylistsUrl(playlistUrl: string): void {
this.isLoading = true;
this.electronService.ipcRenderer.send('parse-playlist-by-url', {
title: this.getLastUrlSegment(playlistUrl),
url: playlistUrl,
Expand Down
2 changes: 1 addition & 1 deletion src/app/home/url-upload/url-upload.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export class UrlUploadComponent implements OnInit {
constructor(private fb: FormBuilder) {}

ngOnInit(): void {
const urlRegex = '(https?://.*?.(m3u|m3u8))';
const urlRegex = '(https?://.*?)';
this.form = this.fb.group({
playlistUrl: [
'',
Expand Down

0 comments on commit 4f366d9

Please sign in to comment.