summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--clerk.conf3
-rwxr-xr-xclerk_rating_client14
2 files changed, 15 insertions, 2 deletions
diff --git a/clerk.conf b/clerk.conf
index 32abf9b..9cd3449 100644
--- a/clerk.conf
+++ b/clerk.conf
@@ -2,6 +2,9 @@
# MPD_HOST will override this
mpd_host=localhost
+# music root for rating_client
+music_root=/mnt/Music
+
# define file paths
database=PLACEHOLDER/.config/clerk/database.mpk
tmux_config=PLACEHOLDER/.config/clerk/clerk.tmux
diff --git a/clerk_rating_client b/clerk_rating_client
index 9662745..fa4034b 100755
--- a/clerk_rating_client
+++ b/clerk_rating_client
@@ -5,6 +5,7 @@ use v5.10;
use warnings;
use Array::Utils qw(:all);
#use DDP;
+use Config::Simple;
use File::Spec;
use strict;
use utf8;
@@ -13,9 +14,18 @@ use File::Find;
use Getopt::Std;
use Net::MPD;
-my $mpd_host = "tauron";
+my $config_file = $ENV{'HOME'} . "/.config/clerk/clerk.conf";
+
+if ($ENV{CLERK_CONF}) {
+ $config_file = $ENV{CLERK_CONF};
+}
+
+my $cfg = new Config::Simple(filename=>"$config_file");
+my $general_cfg = $cfg->param(-block=>"General");
+my $mpd_host = $general_cfg->{mpd_host};
+my $music_root = $general_cfg->{music_root};
+
my $mpd = Net::MPD->connect($ENV{MPD_HOST} // $mpd_host // 'localhost');
-my $music_root = "/mnt/raid/Audio/Rips";
sub main {
my %options=();