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)