Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
main, db_migrate: Fully type migrations
Browse files Browse the repository at this point in the history
C0rn3j committed Nov 24, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
1 parent a22bf43 commit 84c8886
Showing 2 changed files with 15 additions and 6 deletions.
19 changes: 14 additions & 5 deletions src/tauon/t_modules/t_db_migrate.py
Original file line number Diff line number Diff line change
@@ -8,13 +8,13 @@
from typing import TYPE_CHECKING

if TYPE_CHECKING:
from tauon.t_modules.t_main import GuiVar, Prefs, StarStore, TauonPlaylist
from tauon.t_modules.t_main import GuiVar, Prefs, StarStore, TauonPlaylist, TauonQueueItem, TrackClass


def database_migrate(
*,
db_version: float,
master_library: dict,
master_library: dict[int, TrackClass],
install_mode: bool,
multi_playlist: list[TauonPlaylist],
star_store: StarStore,
@@ -24,12 +24,21 @@ def database_migrate(
install_directory: str,
user_directory: str,
gui: GuiVar,
gen_codes: dict,
gen_codes: dict[int, str],
prefs: Prefs,
radio_playlists: list[TauonPlaylist],
p_force_queue: list,
p_force_queue: list[TauonQueueItem],
theme: int,
) -> tuple[dict, list[TauonPlaylist], StarStore, list, int, Prefs, GuiVar, dict, list[TauonPlaylist]]:
) -> tuple[
dict[int, TrackClass],
list[TauonPlaylist],
StarStore,
list[TauonQueueItem],
int,
Prefs,
GuiVar,
dict[int, str],
list[TauonPlaylist]]:
"""Migrate database to a newer version if we're behind
Returns all the objects that could've been possibly changed:
2 changes: 1 addition & 1 deletion src/tauon/t_modules/t_main.py
Original file line number Diff line number Diff line change
@@ -1029,7 +1029,7 @@ def print(self, message: str, level: int = 0) -> None:

shift_selection = []

gen_codes = {}
gen_codes: dict[int, str] = {}
# Control Variables--------------------------------------------------------------------------

mouse_down = False

0 comments on commit 84c8886

Please sign in to comment.