diff --git a/main.cpp b/main.cpp index cfdf475..d962fe8 100644 --- a/main.cpp +++ b/main.cpp @@ -441,11 +441,11 @@ bool save_json(const std::string &filename, const json &data) { } } -std::string database_filename = "yttool.sqlite"; int main() { user_home = std::string(std::getenv("HOME")); + std::string database_filename = user_home + "/.local/share/yttui.db"; std::vector config_locations{user_home + "/.config/", "./"}; curl_global_init(CURL_GLOBAL_ALL); @@ -473,7 +473,7 @@ int main() } } if(config.count("database") && config["database"].is_string()) { - database_filename = config["database"]; + database_filename = replace(config["database"], "$HOME", user_home); } if(config.count("watchCommand") && config["watchCommand"].is_array()) { watch_command.clear(); diff --git a/yttui.conf.example b/yttui.conf.example index 6e8c188..a9df8a3 100644 --- a/yttui.conf.example +++ b/yttui.conf.example @@ -3,5 +3,6 @@ "extraHeaders": [ {"key": "x-extra", "value": "heder"} ], + "database": "$HOME/yttui.db", "watchCommand": ["xdg-open", "https://youtube.com/watch?v={{vid}}"] }