]> kaliko git repositories - mpd-sima.git/blobdiff - sima/plugins/internal/crop.py
Fixed some code style and comment
[mpd-sima.git] / sima / plugins / internal / crop.py
index af6b3175d5203829568e44d27bf309a87a7938fc..8f70acd7caf42d703bf75b6feeb339404dd37757 100644 (file)
@@ -1,5 +1,5 @@
 # -*- coding: utf-8 -*-
-# Copyright (c) 2013, 2014, 2015 Jack Kaliko <kaliko@azylum.org>
+# Copyright (c) 2013-2015, 2020 kaliko <kaliko@azylum.org>
 #
 #  This file is part of sima
 #
 """
 
 # standard library import
-#from select import select
 
 # third parties components
 
 # local import
 from ...lib.plugin import Plugin
 
+
 class Crop(Plugin):
     """
     Crop playlist on next track
-    kinda MPD's consume
     """
     def __init__(self, daemon):
         super().__init__(daemon)
@@ -51,19 +50,19 @@ class Crop(Plugin):
                              'expecting an integer, not "%s"', target)
         else:
             self.target = int(target)
-            self.log.debug('Cropping at 15')
+            self.log.debug('Cropping at %s', self.target)
 
     def callback_next_song(self):
         if not self.target:
             return
         if not self.daemon.enabled:
             self.log.debug('Queueing disabled, not cropping')
-            return False
+            return
         player = self.daemon.player
         if player.currentsong().pos > self.target:
             self.log.debug('cropping playlist')
         while player.currentsong().pos > self.target:
-            player.remove()
+            player.delete(0)
 
 
 # VIM MODLINE