]> git.draconx.ca Git - mpdhacks.git/blobdiff - MPDHacks.pm
mpdthumb: Fix failure when readpicture/albumart both return data.
[mpdhacks.git] / MPDHacks.pm
index 0f5026eb237e7d9f60f3861cbbbc9d0cc6e268b9..7da3b06b7e5258a0413b0b7b17f518e20a1175f7 100644 (file)
@@ -115,4 +115,14 @@ sub exec {
        print $sock "$cmd\n";
 }
 
+# Submit a command to the MPD server and wait for it to complete.
+# Intended for simple cases where the command output is unneeded.
+sub run {
+       MPD::exec(@_);
+       while (<$sock>) {
+               last if (/^OK/);
+               die($_) if (/^ACK/);
+       }
+}
+
 1;