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.

This commit is contained in:
James Barnsley
2020-09-27 21:07:06 +13:00
parent b8c42795e1
commit 4c003f93dc
2 changed files with 1 additions and 10 deletions

View File

@ -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') {

View File

@ -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) => {