Fix MariaDB bug workaround

Fixes #265
This commit is contained in:
Keith Edmunds 2024-12-02 18:56:00 +00:00
parent ecd5c65695
commit c7253e2211
2 changed files with 7 additions and 1 deletions

View File

@ -204,12 +204,14 @@ class ReplaceFilesDialog(QDialog):
if candidates_by_title:
# Check artist tag
for cbt in candidates_by_title:
if not os.path.exists(cbt.path):
return None
try:
cbt_artist = get_tags(cbt.path)["artist"]
if cbt_artist.lower() == new_path_artist.lower():
match_track = cbt
break
except FileNotFoundError:
except KeyError:
return None
return match_track

View File

@ -1338,10 +1338,14 @@ class Window(QMainWindow, Ui_MainWindow):
session.commit()
except IntegrityError:
# https://jira.mariadb.org/browse/MDEV-29345 workaround
log.debug(
"Working around https://jira.mariadb.org/browse/MDEV-29345"
)
session.rollback()
track.path = "DUMMY"
session.commit()
track.path = rf.track_path
session.commit()
else:
session.commit()
else: