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:
@ -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') {
|
||||
|
||||
@ -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) => {
|
||||
|
||||
Reference in New Issue
Block a user