Report track import errors correctly
This commit is contained in:
parent
91cef9e506
commit
3922be2642
@ -784,7 +784,7 @@ class Tracks(Base):
|
|||||||
except IntegrityError as error:
|
except IntegrityError as error:
|
||||||
session.rollback()
|
session.rollback()
|
||||||
log.error(f"Error ({error=}) importing track ({path=})")
|
log.error(f"Error ({error=}) importing track ({path=})")
|
||||||
raise ValueError
|
raise ValueError(error)
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def get_all(cls, session) -> List["Tracks"]:
|
def get_all(cls, session) -> List["Tracks"]:
|
||||||
|
|||||||
@ -170,7 +170,7 @@ class ImportTrack(QObject):
|
|||||||
try:
|
try:
|
||||||
track = Tracks(session, **metadata)
|
track = Tracks(session, **metadata)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
self.signals.show_warning_signal.emit("Error importing track", e)
|
self.signals.show_warning_signal.emit("Error importing track", str(e))
|
||||||
return
|
return
|
||||||
helpers.normalise_track(track.path)
|
helpers.normalise_track(track.path)
|
||||||
# We're importing potentially multiple tracks in a loop.
|
# We're importing potentially multiple tracks in a loop.
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user