Skip to content

Instantly share code, notes, and snippets.

@sydlawrence
Forked from jherskowitz/Example Tomahawk Resolver
Last active December 24, 2015 07:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save sydlawrence/6763916 to your computer and use it in GitHub Desktop.
Save sydlawrence/6763916 to your computer and use it in GitHub Desktop.
/*
* (c) 2011 Dominik Schmidt <domme@tomahawk-player.org>
*/
var DummyResolver = Tomahawk.extend(TomahawkResolver,
{
settings:
{
name: 'Dummy Resolver',
weight: 75,
timeout: 5
},
resolve: function( qid, artist, album, title )
{
var searchString = artist+" "+title";
return Tomahawk.addTrackResults( this.internalSearch( qid, searchString) );
},
search: function( qid, searchString )
{
Tomahawk.addTrackResults( this.internalSearch( qid, searchString ) );
},
internalSearch: function( qid, searchString )
{
return {
qid: qid,
results: [
{
artist: "Mokele",
album: "You Yourself are Me Myself and I am in Love",
track: "Hiding In Your Insides (js)",
source: "Mokele.co.uk",
url: "http://play.mokele.co.uk/music/Hiding%20In%20Your%20Insides.mp3",
bitrate: 160,
duration: 248,
size: 4971780,
score: 1.0,
extension: "mp3",
mimetype: "audio/mpeg"
}
]
};
}
});
Tomahawk.resolver.instance = DummyResolver;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment