mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-04-13 04:21:51 +02:00
[tomahawk.js] Add Promise resolver adapter
This commit is contained in:
parent
0ec9823308
commit
940b1044e9
@ -206,6 +206,28 @@ var TomahawkResolver = {
|
||||
}
|
||||
};
|
||||
|
||||
Tomahawk.Resolver = {};
|
||||
Tomahawk.Resolver.Promise = Tomahawk.extend(TomahawkResolver, {
|
||||
_adapter_resolve: function (qid, artist, album, title) {
|
||||
Promise.resolve(this.resolve(artist, album, title)).then(function(results){
|
||||
Tomahawk.addTrackResults({
|
||||
'qid': qid,
|
||||
'results': results
|
||||
});
|
||||
});
|
||||
},
|
||||
|
||||
_adapter_search: function (qid, query)
|
||||
{
|
||||
Promise.resolve(this.search(query)).then(function(results){
|
||||
Tomahawk.addTrackResults({
|
||||
'qid': qid,
|
||||
'results': results
|
||||
});
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
/**** begin example implementation of a resolver ****/
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user