summaryrefslogtreecommitdiffstats
path: root/feeding_example.py
diff options
context:
space:
mode:
Diffstat (limited to 'feeding_example.py')
-rwxr-xr-xfeeding_example.py10
1 files changed, 7 insertions, 3 deletions
diff --git a/feeding_example.py b/feeding_example.py
index 404af27..d9bde2b 100755
--- a/feeding_example.py
+++ b/feeding_example.py
@@ -12,10 +12,14 @@ m.connect_from_env(mpd_host, mpd_port)
m.wait_for_update()
# get all "final" directories
-m.update_final_dirs("")
+nb_dirs = len(m.get_final_dirs())
+print "We have found %s albums." % nb_dirs
# if the playlist is empty, add one random album
-if m.is_playlist_hungry(1):
- m.add(m.get_random_dir())
+while m.is_playlist_hungry(100) and nb_dirs:
+ rdir = m.get_random_dir()
+ m.add(rdir)
+ print "Added %s" % rdir
print m.status()
+print m.stats()