From ae21aa859a7439843229a1b26af0953f72eeb91d Mon Sep 17 00:00:00 2001 From: Basile Bruneau Date: Thu, 2 Mar 2017 12:48:16 +0100 Subject: [PATCH] Display only youtube-dl errors --- app/src/app/alltomp3.service.ts | 6 ++++-- package.json | 6 +++--- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/app/src/app/alltomp3.service.ts b/app/src/app/alltomp3.service.ts index 5855f6e..baa66a9 100644 --- a/app/src/app/alltomp3.service.ts +++ b/app/src/app/alltomp3.service.ts @@ -55,8 +55,10 @@ export class Alltomp3Service { let r = _.find(this.requests, {id: data.id}); if (type == "Error" || data.data.error) { let yterror = data.data.message; - yterror = yterror.replace(/^[\s\S]+YouTube said: .+\n(.+)\n$/g, '$1'); - r.artistName = yterror; + if (yterror.match(/YouTube said/)) { // youtube-dl error + yterror = yterror.replace(/^[\s\S]+YouTube said: .+\n(.+)\n$/g, '$1'); + r.artistName = yterror; + } } if (r.playlist == true) { var mainr = r; // keep a reference to the main request diff --git a/package.json b/package.json index a76a73c..2f6615e 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "AllToMP3", - "version": "0.1.5", + "version": "0.1.6", "description": "Download YouTube videos in MP3 with tags and lyrics", "main": "main.js", "repository": "git@github.com:AllToMP3/alltomp3-app.git", @@ -33,8 +33,8 @@ "icon": "build/dmg.icns", "contents": [ { - "x": 0, - "y": 90 + "x": 0, + "y": 90 }, { "x": 220,