def __on_playback_track_start(self, event, player, track): '''Every time a track plays, add it to the playlist''' maxlen = int(settings.get_option( 'plugin/history/history_length', history_preferences.history_length_default )) if maxlen < 0: maxlen = 0 settings.set_option( 'plugin/history/history_length', 0 ) if len(self) >= maxlen-1: Playlist.__delitem__( self, slice(0, max(0, len(self)-(maxlen-1)), None) ) Playlist.__setitem__( self, slice(len(self),len(self),None), [track] )
def clear(self): Playlist.__delitem__(self, slice(None, None, None))
def clear(self): Playlist.__delitem__( self, slice(None, None, None) )