forked from Wobbl/Wobuzz
Fixed Wobbl/Wobuzz#12
This commit is contained in:
parent
5c7f4c4ef7
commit
7fdf7a66a9
2 changed files with 15 additions and 1 deletions
|
@ -22,7 +22,7 @@ class Track:
|
|||
self.duration = 0
|
||||
|
||||
self.items = []
|
||||
self.occurrences = {} # all occurrences in playlists categorized by playlist and track widget
|
||||
self.occurrences = {} # all occurrences in playlists categorized by playlist and id of the track widget
|
||||
|
||||
if cache:
|
||||
self.cache()
|
||||
|
@ -94,3 +94,14 @@ class Track:
|
|||
|
||||
# return the remaining part of the track's audio and the duration of the remaining part
|
||||
return sound, len(remaining_audio)
|
||||
|
||||
def delete_items(self, playlist):
|
||||
"""
|
||||
Deletes all QTreeWidgetItems that correspond to this track and the given playlist.
|
||||
"""
|
||||
|
||||
for item in self.items:
|
||||
if id(item) in self.occurrences[playlist]:
|
||||
self.items.remove(item)
|
||||
|
||||
self.occurrences.pop(playlist)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue