Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor t_phazor.py to put classes in root of the module #1472

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 12 additions & 15 deletions src/tauon/t_modules/t_main.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
from __future__ import annotations



import base64
import builtins
import certifi
Expand Down Expand Up @@ -160,7 +159,7 @@
from tauon.t_modules.t_jellyfin import Jellyfin
from tauon.t_modules.t_launch import Launch
from tauon.t_modules.t_lyrics import genius, lyric_sources, uses_scraping
from tauon.t_modules.t_phazor import phazor_exists, player4
from tauon.t_modules.t_phazor import phazor_exists, player4, Cachement, LibreSpot
from tauon.t_modules.t_prefs import Prefs
from tauon.t_modules.t_search import bandcamp_search
from tauon.t_modules.t_spot import SpotCtl
Expand All @@ -175,7 +174,7 @@
from io import BufferedReader, BytesIO
from pylast import Artist, LibreFMNetwork
from PIL.ImageFile import ImageFile

from subprocess import Popen

class LoadImageAsset:
assets: list[LoadImageAsset] = []
Expand Down Expand Up @@ -1430,8 +1429,8 @@ def __init__(self):
self.player_volume: float = volume
self.new_time = 0
self.time_to_get = []
self.a_time = 0
self.b_time = 0
self.a_time: float = 0
self.b_time: float = 0
# self.playlist_backup = []
self.active_replaygain = 0
self.auto_stop = False
Expand Down Expand Up @@ -3894,8 +3893,7 @@ def process_queue(self):

self.running = False

def update(self, add_time):

def update(self, add_time: float) -> None:
if pctl.queue_step > len(pctl.track_queue) - 1:
logging.info("Queue step error 1")
return
Expand Down Expand Up @@ -4898,8 +4896,6 @@ def __init__(self, renderer: sdl3.SDL_Renderer, e_cache_directory: Path) -> None
self.device = socket.gethostname()
self.tls_context = tls_context

#TODO(Martin): Fix this by moving the class to root of the module
self.cachement: player4.Cachement | None = None
self.dummy_event: sdl3.SDL_Event = sdl3.SDL_Event()
self.translate = _
self.strings: Strings = strings
Expand Down Expand Up @@ -4954,7 +4950,12 @@ def __init__(self, renderer: sdl3.SDL_Renderer, e_cache_directory: Path) -> None

self.copied_track = None
self.macos = macos
self.aud: CDLL | None = None
self.aud: CDLL | None = None
self.player4_state: int = 0
self.librespot_p: Popen[bytes] | None = None
self.spot_ctl = SpotCtl(self)
self.cachement = Cachement(self)
self.spotc = LibreSpot(self)

self.recorded_songs = []

Expand All @@ -4964,16 +4965,12 @@ def __init__(self, renderer: sdl3.SDL_Renderer, e_cache_directory: Path) -> None
self.remote_limited = True
self.enable_librespot = shutil.which("librespot")

#TODO(Martin): Fix this by moving the class to root of the module
self.spotc: player4.LibreSpot | None = None
self.librespot_p = None
self.MenuItem = MenuItem
self.tag_scan = tag_scan

self.gme_formats = GME_Formats

self.spot_ctl: SpotCtl = SpotCtl(self)
self.tidal: Tidal = Tidal(self)
self.tidal = Tidal(self)
self.chrome: Chrome | None = None
self.chrome_menu: Menu | None = None

Expand Down
Loading
Loading