Black formatting
This commit is contained in:
parent
71257e4d67
commit
5e4277646b
@ -118,11 +118,8 @@ def get_embedded_time(text: str) -> Optional[dt.datetime]:
|
|||||||
def get_all_track_metadata(filepath: str) -> Dict[str, str | int | float]:
|
def get_all_track_metadata(filepath: str) -> Dict[str, str | int | float]:
|
||||||
"""Return all track metadata"""
|
"""Return all track metadata"""
|
||||||
|
|
||||||
return (
|
return get_audio_metadata(filepath) | get_tags(filepath) | dict(path=filepath)
|
||||||
get_audio_metadata(filepath)
|
|
||||||
| get_tags(filepath)
|
|
||||||
| dict(path=filepath)
|
|
||||||
)
|
|
||||||
|
|
||||||
def get_audio_metadata(filepath: str) -> Dict[str, str | int | float]:
|
def get_audio_metadata(filepath: str) -> Dict[str, str | int | float]:
|
||||||
"""Return audio metadata"""
|
"""Return audio metadata"""
|
||||||
|
|||||||
@ -1320,7 +1320,9 @@ class Window(QMainWindow, Ui_MainWindow):
|
|||||||
width = Settings.get_setting(session, "mainwindow_width").f_int or 100
|
width = Settings.get_setting(session, "mainwindow_width").f_int or 100
|
||||||
height = Settings.get_setting(session, "mainwindow_height").f_int or 100
|
height = Settings.get_setting(session, "mainwindow_height").f_int or 100
|
||||||
splitter_top = Settings.get_setting(session, "splitter_top").f_int or 100
|
splitter_top = Settings.get_setting(session, "splitter_top").f_int or 100
|
||||||
splitter_bottom = Settings.get_setting(session, "splitter_bottom").f_int or 100
|
splitter_bottom = (
|
||||||
|
Settings.get_setting(session, "splitter_bottom").f_int or 100
|
||||||
|
)
|
||||||
|
|
||||||
self.setGeometry(x, y, width, height)
|
self.setGeometry(x, y, width, height)
|
||||||
self.splitter.setSizes([splitter_top, splitter_bottom])
|
self.splitter.setSizes([splitter_top, splitter_bottom])
|
||||||
@ -1619,9 +1621,7 @@ class SelectPlaylistDialog(QDialog):
|
|||||||
|
|
||||||
record = Settings.get_setting(self.session, "select_playlist_dialog_width")
|
record = Settings.get_setting(self.session, "select_playlist_dialog_width")
|
||||||
width = record.f_int or 800
|
width = record.f_int or 800
|
||||||
record = Settings.get_setting(
|
record = Settings.get_setting(self.session, "select_playlist_dialog_height")
|
||||||
self.session, "select_playlist_dialog_height"
|
|
||||||
)
|
|
||||||
height = record.f_int or 600
|
height = record.f_int or 600
|
||||||
self.resize(width, height)
|
self.resize(width, height)
|
||||||
|
|
||||||
@ -1632,9 +1632,7 @@ class SelectPlaylistDialog(QDialog):
|
|||||||
self.ui.lstPlaylists.addItem(p)
|
self.ui.lstPlaylists.addItem(p)
|
||||||
|
|
||||||
def __del__(self): # review
|
def __del__(self): # review
|
||||||
record = Settings.get_setting(
|
record = Settings.get_setting(self.session, "select_playlist_dialog_height")
|
||||||
self.session, "select_playlist_dialog_height"
|
|
||||||
)
|
|
||||||
record.f_int = self.height()
|
record.f_int = self.height()
|
||||||
|
|
||||||
record = Settings.get_setting(self.session, "select_playlist_dialog_width")
|
record = Settings.get_setting(self.session, "select_playlist_dialog_width")
|
||||||
|
|||||||
@ -113,7 +113,9 @@ class MyTestCase(unittest.TestCase):
|
|||||||
model = playlistmodel.PlaylistModel(playlist.id)
|
model = playlistmodel.PlaylistModel(playlist.id)
|
||||||
|
|
||||||
# Add a track with a note
|
# Add a track with a note
|
||||||
model.insert_row(proposed_row_number=0, track_id=self.tracks[1]['id'], note=note_text)
|
model.insert_row(
|
||||||
|
proposed_row_number=0, track_id=self.tracks[1]["id"], note=note_text
|
||||||
|
)
|
||||||
|
|
||||||
# We need to commit the session before re-querying
|
# We need to commit the session before re-querying
|
||||||
session.commit()
|
session.commit()
|
||||||
@ -124,7 +126,7 @@ class MyTestCase(unittest.TestCase):
|
|||||||
retrieved_playlist = all_playlists[0]
|
retrieved_playlist = all_playlists[0]
|
||||||
assert len(retrieved_playlist.rows) == 1
|
assert len(retrieved_playlist.rows) == 1
|
||||||
paths = [a.track.path for a in retrieved_playlist.rows]
|
paths = [a.track.path for a in retrieved_playlist.rows]
|
||||||
assert self.tracks[1]['path'] in paths
|
assert self.tracks[1]["path"] in paths
|
||||||
notes = [a.note for a in retrieved_playlist.rows]
|
notes = [a.note for a in retrieved_playlist.rows]
|
||||||
assert note_text in notes
|
assert note_text in notes
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user