Change default database location and name
This commit is contained in:
parent
b4c4fb75c0
commit
9e50c06ceb
4
main.cpp
4
main.cpp
|
@ -441,11 +441,11 @@ bool save_json(const std::string &filename, const json &data) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string database_filename = "yttool.sqlite";
|
|
||||||
|
|
||||||
int main()
|
int main()
|
||||||
{
|
{
|
||||||
user_home = std::string(std::getenv("HOME"));
|
user_home = std::string(std::getenv("HOME"));
|
||||||
|
std::string database_filename = user_home + "/.local/share/yttui.db";
|
||||||
std::vector<std::string> config_locations{user_home + "/.config/", "./"};
|
std::vector<std::string> config_locations{user_home + "/.config/", "./"};
|
||||||
|
|
||||||
curl_global_init(CURL_GLOBAL_ALL);
|
curl_global_init(CURL_GLOBAL_ALL);
|
||||||
|
@ -473,7 +473,7 @@ int main()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(config.count("database") && config["database"].is_string()) {
|
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()) {
|
if(config.count("watchCommand") && config["watchCommand"].is_array()) {
|
||||||
watch_command.clear();
|
watch_command.clear();
|
||||||
|
|
|
@ -3,5 +3,6 @@
|
||||||
"extraHeaders": [
|
"extraHeaders": [
|
||||||
{"key": "x-extra", "value": "heder"}
|
{"key": "x-extra", "value": "heder"}
|
||||||
],
|
],
|
||||||
|
"database": "$HOME/yttui.db",
|
||||||
"watchCommand": ["xdg-open", "https://youtube.com/watch?v={{vid}}"]
|
"watchCommand": ["xdg-open", "https://youtube.com/watch?v={{vid}}"]
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue