Add support for matching from Youtube urls

This commit is contained in:
Jonathan Cremin 2015-01-12 17:38:42 +00:00
parent 7d3173c57e
commit 599e9b0850
12 changed files with 130 additions and 14 deletions

View file

@ -9,7 +9,7 @@ module.exports = React.createClass({
render: function() {
return (
<html>
<Head />
<Head {...this.props} />
<body>
<div className="error">
<header>

View file

@ -22,6 +22,10 @@ module.exports = React.createClass({
<h3>Where do I find a link to paste in the box?</h3>
<p>Most music services have a "share" dialog for albums and tracks in their interface. If you have them open in a web browser instead of an app, you can simply copy and paste the address bar and we'll work out the rest.</p>
</li>
<li>
<h3>Why don't you guys support Bandcamp, Amazon Music, Sony Music Unlimited&hellip; ?</h3>
<p>Let me stop you there. <a href="https://github.com/kudos/match.audio">Match Audio is open source</a>, that means any capable programmer who wants to add other music services can look at our code and submit changes. If you're not a programmer, you can always <a href="https://github.com/kudos/match.audio/issues">submit a request</a> and maybe we'll do it for you.</p>
</li>
</ul>
</div>
</div>

View file

@ -47,7 +47,8 @@ var SearchForm = React.createClass({
getInitialState: function () {
return {
submitting: true
submitting: true,
error: false
};
},
@ -69,7 +70,7 @@ var SearchForm = React.createClass({
submitting: false
});
if (res.body.error) {
return alert(res.body.error.message)
that.setState({error: res.body.error.message});
}
that.transitionTo("share", res.body);
});
@ -77,7 +78,8 @@ var SearchForm = React.createClass({
componentDidMount: function () {
this.setState({
submitting: false
submitting: false,
error: false
});
},
@ -90,6 +92,9 @@ var SearchForm = React.createClass({
<input type="submit" className="btn btn-lg btn-custom" value="Share Music" disabled={this.state.submitting} />
</span>
</div>
<div className={this.state.error ? "alert alert-warning" : ""} role="alert">
{this.state.error}
</div>
</form>
);
}