From 4c003f93dc01f311deb6517dd4754d9c344b87d7 Mon Sep 17 00:00:00 2001 From: James Barnsley Date: Sun, 27 Sep 2020 21:07:06 +1300 Subject: [PATCH] Removing validator for add URIs - Mopidy can handle validation; Easily-validated URIs are still loaded to show title/artist before adding. Fixes #610 and #599 and prevents future errors of the same type. --- src/js/util/helpers.js | 8 -------- src/js/views/modals/AddToQueue.js | 3 +-- 2 files changed, 1 insertion(+), 10 deletions(-) diff --git a/src/js/util/helpers.js b/src/js/util/helpers.js index 376cfeca..997f6d87 100755 --- a/src/js/util/helpers.js +++ b/src/js/util/helpers.js @@ -150,14 +150,6 @@ const uriType = function (uri) { return 'playlist'; } - if (exploded[0] === 'yt') { - return 'track'; - } - - if (exploded[0] === 'sc') { - return 'track'; - } - if (exploded[0] === 'youtube') { const youtubeParts = exploded[1].split('/'); if (youtubeParts[0] === 'video') { diff --git a/src/js/views/modals/AddToQueue.js b/src/js/views/modals/AddToQueue.js index 30bff721..d108ea77 100755 --- a/src/js/views/modals/AddToQueue.js +++ b/src/js/views/modals/AddToQueue.js @@ -139,13 +139,12 @@ class AddToQueue extends React.Component { const uris = text.split(','); const validatedUris = uris.filter((uri) => uriType(uri)); - validatedUris.forEach((uri) => { loadItem(uri); }); this.setState({ text: '' }); - viewDataLoaded({ uris: [...prevUris, ...validatedUris] }); + viewDataLoaded({ uris: [...prevUris, ...uris] }); // We add all uris (validated and otherwise) } removeUri = (uri) => {