diff --git a/client/djrandom_client/client.py b/client/djrandom_client/client.py index 09b342ed350a6d0192f4515db6f159502d7b699a..f21888635a4ec933765ef4cd90f48e51ea7d0f91 100644 --- a/client/djrandom_client/client.py +++ b/client/djrandom_client/client.py @@ -55,6 +55,10 @@ def run_client(server_url, music_dir, api_key, run_once, bwlimit, enable_watcher if bwlimit: throttle.set_rate_limit(bwlimit) + # Warn on this condition, but don't die -- the directory might exist later! + if not os.path.isdir(music_dir): + log.error('The music_dir you specified does not exist') + if enable_watcher and not watcher_support: log.warn('inotify/fsevents support not enabled on this platform') enable_watcher = False @@ -128,8 +132,8 @@ def main(): opts, args = parser.parse_args() if not opts.api_key: parser.error('You must specify an API Key') - if not os.path.isdir(opts.music_dir): - parser.error('The --music_dir you specified does not exist') + + music_dir = os.path.expanduser(opts.music_dir) if args: parser.error('Too many arguments') @@ -142,7 +146,7 @@ def main(): do_realtime = not opts.no_realtime_watch daemonize.daemonize(opts, run_client, - (opts.server_url, opts.music_dir, opts.api_key, + (opts.server_url, music_dir, opts.api_key, opts.once, opts.bwlimit, do_realtime))