Skip to content

Commit

Permalink
Removing validator for add URIs - Mopidy can handle validation; Easil…
Browse files Browse the repository at this point in the history
…y-validated URIs are still loaded to show title/artist before adding. Fixes #610 and #599 and prevents future errors of the same type.
  • Loading branch information
jaedb committed Sep 27, 2020
1 parent b8c4279 commit 4c003f9
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 10 deletions.
8 changes: 0 additions & 8 deletions src/js/util/helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -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') {
Expand Down
3 changes: 1 addition & 2 deletions src/js/views/modals/AddToQueue.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) => {
Expand Down

0 comments on commit 4c003f9

Please sign in to comment.