fix db path

This commit is contained in:
jb-alvarado 2023-10-24 10:41:09 +02:00
parent c0bad651db
commit 5fb5851b49
4 changed files with 8 additions and 10 deletions

8
Cargo.lock generated
View File

@ -1112,7 +1112,7 @@ checksum = "25cbce373ec4653f1a01a31e8a5e5ec0c622dc27ff9c4e6606eefef5cbbed4a5"
[[package]]
name = "ffplayout"
version = "0.20.0-beta1"
version = "0.20.0-beta2"
dependencies = [
"chrono",
"clap",
@ -1134,7 +1134,7 @@ dependencies = [
[[package]]
name = "ffplayout-api"
version = "0.20.0-beta1"
version = "0.20.0-beta2"
dependencies = [
"actix-files",
"actix-multipart",
@ -1167,7 +1167,7 @@ dependencies = [
[[package]]
name = "ffplayout-lib"
version = "0.20.0-beta1"
version = "0.20.0-beta2"
dependencies = [
"chrono",
"crossbeam-channel",
@ -3126,7 +3126,7 @@ dependencies = [
[[package]]
name = "tests"
version = "0.20.0-beta1"
version = "0.20.0-beta2"
dependencies = [
"chrono",
"crossbeam-channel",

View File

@ -4,7 +4,7 @@ default-members = ["ffplayout-api", "ffplayout-engine", "tests"]
resolver = "2"
[workspace.package]
version = "0.20.0-beta1"
version = "0.20.0-beta2"
license = "GPL-3.0"
repository = "https://github.com/ffplayout/ffplayout"
authors = ["Jonathan Baecker <jonbae77@gmail.com>"]

View File

@ -82,6 +82,8 @@ async fn create_schema(conn: &Pool<Sqlite>) -> Result<SqliteQueryResult, sqlx::E
pub async fn db_init(domain: Option<String>) -> Result<&'static str, Box<dyn std::error::Error>> {
let db_path = db_path()?;
println!("--- db_path: {db_path:?}");
if !Sqlite::database_exists(db_path).await.unwrap_or(false) {
Sqlite::create_database(db_path).await.unwrap();

View File

@ -88,11 +88,7 @@ pub fn db_path() -> Result<&'static str, Box<dyn std::error::Error>> {
db_path = "./assets/ffplayout.db";
}
if Path::new(db_path).is_file() {
return Ok(db_path);
}
Err(format!("DB path {db_path} not exists!").into())
Ok(db_path)
}
pub async fn run_args(mut args: Args) -> Result<(), i32> {