Add clear search history API (#26)
* Add clear search history API * changelog
This commit is contained in:
1 parent
aa6cc6eb54
commit
f71c70d90b
3 files changed
+19
No files matched your search
@@ -27,6 +27,10 @@ namespace Http
|
||||
server.task.top.command = `play:${videoId}`
|
||||
response.Default(204, "OK")
|
||||
return true
|
||||
else if payload.command = "clear-search-history"
|
||||
RegistryUtils.Delete("search_history")
|
||||
response.Default(204, "OK")
|
||||
return true
|
||||
end if
|
||||
|
||||
response.Default(400, `Invalid command: ${payload.command}`)
|
||||
|
||||
@@ -57,6 +57,8 @@
|
||||
</table>
|
||||
</br>
|
||||
<button style="display: none" id="update-instances" onclick="UpdateInstances()">Update Instances</button>
|
||||
</br>
|
||||
<button onclick="ClearSearchHistory()">Clear Search History</button>
|
||||
|
||||
<h5>Instructions</h5>
|
||||
<ul>
|
||||
@@ -106,6 +108,16 @@
|
||||
});
|
||||
}
|
||||
|
||||
function ClearSearchHistory() {
|
||||
PostJson('/api/command', { command: "clear-search-history" })
|
||||
.then(function (response) {
|
||||
alert("Search history cleared");
|
||||
})
|
||||
.catch(function (err) {
|
||||
alert(err)
|
||||
});
|
||||
}
|
||||
|
||||
function CreateGithubIssueUrl() {
|
||||
title = "[Feedback] Playlet"
|
||||
body = `### Feedback
|
||||
|
||||
Reference in new issue
Block a user