]> kaliko git repositories - mpd-goodies.git/commitdiff
* Fixed #1705
authorkaliko <kaliko@azylum.org>
Fri, 6 Aug 2010 08:30:43 +0000 (08:30 +0000)
committerkaliko <kaliko@azylum.org>
Fri, 6 Aug 2010 08:30:43 +0000 (08:30 +0000)
crop

diff --git a/crop b/crop
index 2b255f18aa3f4095bf8c4888fe2d2c7fc726804e..944241a1c4bcf35723a2a0bdb0a6d70cd737f050 100755 (executable)
--- a/crop
+++ b/crop
@@ -60,13 +60,13 @@ class Crop(StartOpt, MPDClass):
         print 'Connecting %s:%i' % (self.cli_options.host, self.cli_options.port)
         print 'Keeping %i tracks' % self.nb_tracks
         self.mpdConnect()
-        current_pos = int(self.client.currentsong().get('pos'))
+        current_pos = int(self.client.currentsong().get('pos', 0))
         if current_pos <=  self.nb_tracks:
             self.client.disconnect()
             sys.exit(0)
         while current_pos > self.nb_tracks:
             self.client.delete(0)
-            current_pos = int(self.client.currentsong().get('pos'))
+            current_pos = int(self.client.currentsong().get('pos', 0))
         self.client.disconnect()
         sys.exit(0)