Example #1
0
    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] )
Example #2
0
    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] )
Example #3
0
 def clear(self):
     Playlist.__delitem__(self, slice(None, None, None))
Example #4
0
 def clear(self):
     Playlist.__delitem__( self, slice(None, None, None) )