Added popup on import where the user can configure how the tracks get imported.

This commit is contained in:
The Wobbler 2025-03-08 17:50:45 +01:00
parent 31b2e3bf41
commit fd34476d00
12 changed files with 289 additions and 28 deletions

View file

@ -2,16 +2,16 @@
import os
import threading
from PyQt6.QtCore import Qt
from PyQt6.QtWidgets import QAbstractItemView
from .track import Track, TrackMetadata
from ..wobuzzm3u import WobuzzM3U, WBZM3UData
from ..types import Types
class Playlist:
def __init__(self, app, title: str, load_from=None, import_tracks: bool=False):
def __init__(self, app, title: str, load_from=None, import_options: Types.ImportOptions=None):
self.app = app
self.title = title # playlist title
@ -20,7 +20,7 @@ class Playlist:
# if None, playlist should be already in the library and will be loaded from a .wbz.m3u
self.load_from = load_from
self.import_tracks = import_tracks
self.import_options = import_options
# add to unique names so if the playlist is loaded from disk,
# no other playlist can be created using the same name
@ -96,9 +96,9 @@ class Playlist:
self.loading = False
if self.import_tracks:
if self.import_options is not None:
for track in self.tracks:
self.app.library.import_track(track)
self.app.library.import_track(track, self.import_options)
for dock_id in self.views: # enable drag and drop on every view
view = self.views[dock_id]