Forked from jherskowitz/Example Tomahawk Resolver
Last active
August 29, 2015 14:03
-
-
Save xhochy/aaf211a6551c07f2b069 to your computer and use it in GitHub Desktop.
Example Tomahawk Resolver
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* (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; | |
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