Implement support for the new directory search API

This commit is contained in:
Thomas Perl 2014-10-26 23:15:51 +01:00
parent 6b5864806d
commit 1e87a2a3fb
5 changed files with 68 additions and 23 deletions

View file

@ -66,9 +66,25 @@ SlidePage {
},
},
{
label: 'Search gpodder.net',
label: 'Discover new podcasts',
callback: function () {
pgst.loadPage('Directory.qml');
py.call('main.get_directory_providers', [], function (result) {
var items = [];
for (var i=0; i<result.length; i++) {
(function (provider) {
items.push({
label: provider.label,
callback: function () {
pgst.loadPage('Directory.qml', {
provider: provider.label,
can_search: provider.can_search,
});
},
});
})(result[i]);
}
pgst.showSelection(items, 'Select provider');
});
},
},
]);