diff options
| -rw-r--r-- | flake.nix | 9 | ||||
| -rw-r--r-- | src/audio/ytdl.rs | 7 | ||||
| -rw-r--r-- | src/config.rs | 7 |
3 files changed, 21 insertions, 2 deletions
@@ -269,9 +269,18 @@ SELECT 'CREATE DATABASE ${cfg.postgres.db}' WHERE NOT EXISTS (SELECT FROM pg_database WHERE datname = '${cfg.postgres.db}')\gexec + + ALTER DATABASE ${cfg.postgres.db} OWNER TO ${cfg.user}; EOF echo 'CREATE EXTENSION IF NOT EXISTS pgcrypto' | ${invokePsql} ${cfg.postgres.db} + + for tbl in $(psql -qAt -c "select tablename from pg_tables where schemaname = 'public';" ${cfg.postgres.db}) \ + $(psql -qAt -c "select sequence_name from information_schema.sequences where sequence_schema = 'public';" ${cfg.postgres.db}) \ + $(psql -qAt -c "select table_name from information_schema.views where table_schema = 'public';" ${cfg.postgres.db}) ; + do + psql -c "alter table \"$tbl\" owner to ${cfg.user}" ${cfg.postgres.db}; + done ''; in "+${preStart}"; diff --git a/src/audio/ytdl.rs b/src/audio/ytdl.rs index 002244c..6042f02 100644 --- a/src/audio/ytdl.rs +++ b/src/audio/ytdl.rs @@ -18,7 +18,12 @@ use lazy_static::lazy_static; use crate::{Result, CONFIG}; lazy_static! { - static ref YTDL_COMMAND: String = CONFIG.ytdl.clone().unwrap_or("youtube-dl".to_owned()); + static ref YTDL_COMMAND: String = { + let result = CONFIG.ytdl.clone().unwrap_or("youtube-dl".to_owned()); + log::debug!("got ytdl: {}", result); + + result + }; } pub fn ytdl_url(uri: &str) -> Result<String> { diff --git a/src/config.rs b/src/config.rs index 56e9190..846b25b 100644 --- a/src/config.rs +++ b/src/config.rs @@ -19,7 +19,12 @@ lazy_static! { Config::init().unwrap() }; - pub static ref FFMPEG_COMMAND: String = CONFIG.ffmpeg.clone().unwrap_or("youtube-dl".to_owned()); + pub static ref FFMPEG_COMMAND: String = { + let result = CONFIG.ffmpeg.clone().unwrap_or("youtube-dl".to_owned()); + log::debug!("got ffmpeg: {}", result); + + result + }; } #[derive(Envconfig)] |
