summaryrefslogtreecommitdiffstats
path: root/clerk_rating_client
diff options
context:
space:
mode:
authorRasmus Steinke <rasi@xssn.at>2017-09-23 17:34:28 +0200
committerRasmus Steinke <rasi@xssn.at>2017-09-23 17:34:28 +0200
commit5ec053649f3893f1e4a2323ea83ffac014b40c9f (patch)
tree9feb8c1d29ba1df80a2fe7404cf9764cecb384d5 /clerk_rating_client
parent94d05d5ae1b57f54c4a56cda636cf07e820e6dc5 (diff)
downloadperl-app-clerk-5ec053649f3893f1e4a2323ea83ffac014b40c9f.tar.gz
perl-app-clerk-5ec053649f3893f1e4a2323ea83ffac014b40c9f.tar.xz
add config file support for rating_client
Diffstat (limited to 'clerk_rating_client')
-rwxr-xr-xclerk_rating_client14
1 files changed, 12 insertions, 2 deletions
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=();