From: kaliko Date: Fri, 6 Aug 2010 08:30:43 +0000 (+0000) Subject: * Fixed #1705 X-Git-Url: https://git.kaliko.me/?a=commitdiff_plain;h=9b8c9392a933bc96696ba18fdfe40c9ae02cece0;p=mpd-goodies.git * Fixed #1705 --- diff --git a/crop b/crop index 2b255f1..944241a 100755 --- 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)