added reset functionality

This commit is contained in:
2026-02-17 16:49:52 -06:00
parent b15cf87242
commit 22e26daedf
2 changed files with 13 additions and 1 deletions

View File

@@ -60,4 +60,7 @@ All application data is stored in:
* D: Enter the download visual queue.
* (d on an item in the queue): Remove item from queue.
* X: Deletes the local file if the file exists.
* o: Enter offline playback/Attempt to ping the server to join online mode. (Local downloaded database is available during this mode)
* o: Enter offline playback/Attempt to ping the server to join online mode. (Local downloaded database is available during this mode)
##### Admin Controls
* /\reset"Enter": Deletes the config file and exits the program. Reloading will prompt URL, Username, and Password Input.

View File

@@ -484,6 +484,15 @@ fn handle_key(app: &mut App, code: KeyCode) {
KeyCode::Backspace => { search.input.pop(); return; }
KeyCode::Enter => {
let term = search.input.trim().to_string();
// Special command: reset config + exit
if term == r"\reset" {
if let Some(path) = crate::core::config::config_path() {
let _ = std::fs::remove_file(&path);
}
app.should_exit = true;
return;
}
if term.is_empty() {
app.search = None;
return;