Remove TODOs from code.

Fixes #57
This commit is contained in:
Keith Edmunds 2021-08-23 09:23:18 +01:00
parent d2e2144148
commit d8072ae73f
2 changed files with 5 additions and 9 deletions

View File

@ -1,5 +1,6 @@
#!/usr/bin/python3
import os.path
import sqlalchemy
from datetime import datetime
@ -500,8 +501,7 @@ class Tracks(Base):
DEBUG(f"Tracks.get_track_from_filename({filename=})")
try:
track = session.query(Tracks).filter(Tracks.path.ilike(
# TODO: filename separator is hardcoded here
f'%/{filename}')).one()
f'%{os.path.sep}{filename}')).one()
return track
except (NoResultFound, MultipleResultsFound):
return None

View File

@ -132,7 +132,9 @@ class Window(QMainWindow, Ui_MainWindow):
if self.music.playing():
DEBUG("closeEvent() ignored as music is playing")
event.ignore()
# TODO notify user
helpers.show_warning(
"Track playing",
"Can't close application while track is playing")
else:
DEBUG("closeEvent() accepted")
@ -516,12 +518,6 @@ class Window(QMainWindow, Ui_MainWindow):
silence_at - self.current_track.fade_at
))
def play_previous(self):
"Resume playing last track"
# TODO
pass
def search_database(self):
with Session() as session:
dlg = DbDialog(self, session)