diff --git a/README.md b/README.md index f17cdc4..5a43919 100644 --- a/README.md +++ b/README.md @@ -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) \ No newline at end of file +* 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. \ No newline at end of file diff --git a/src/main.rs b/src/main.rs index c4ad65c..f37598d 100644 --- a/src/main.rs +++ b/src/main.rs @@ -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;