Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update search provider interface to gnome shell 43 #202

Merged
merged 1 commit into from
May 25, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions radio@hslbck.gmail.com/searchProvider.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,28 +38,28 @@ var RadioSearchProvider = class RadioSearchProvider {
};
}

getInitialResultSet(terms, callback) {
getInitialResultSet(terms, cancellable = null) {
let channels = Io.read().channels;
this._results = channels.map(this._createProviderObject);
this.getSubsearchResultSet(undefined, terms, callback);
return new Promise(res => res(this._results));
}

getSubsearchResultSet(previous_results, terms, callback) {
getSubsearchResultSet(previous_results, terms, cancellable = null) {
let search = terms.join(" ").toLowerCase();
function containsSearch(candidate) {
return candidate.name.toLowerCase().indexOf(search) !== -1;
}
function getId(candidate) {
return candidate.id;
};
callback(this._results.filter(containsSearch).map(getId));
return new Promise(res => res(this._results.filter(containsSearch).map(getId)));
}

getResultMetas(ids, callback) {
getResultMetas(ids, cancellable = null) {
let resultMetas = this._results.filter(function (res) {
return ids.indexOf(res.id) !== -1;
});
callback(resultMetas);
return new Promise(res => res(resultMetas));
}

activateResult(id, terms, timestamp) {
Expand Down