Removed old code, that was commented out.

This commit is contained in:
Christoph Stahl 2025-02-15 01:43:51 +01:00
parent 6d56fd7def
commit bf48104acb
4 changed files with 0 additions and 20 deletions

View file

@ -125,9 +125,6 @@ class State:
config: dict[str, Any] = field(default_factory=default_config) config: dict[str, Any] = field(default_factory=default_config)
# state: State = State()
class Client: class Client:
def __init__(self, config: dict[str, Any]): def __init__(self, config: dict[str, Any]):
config["config"] = default_config() | config["config"] config["config"] = default_config() | config["config"]
@ -215,8 +212,6 @@ class Client:
await source.skip_current(Entry(**data)) await source.skip_current(Entry(**data))
self.player.skip_current() self.player.skip_current()
# if self.state.current_source is not None:
# await self.state.current_source.skip_current(Entry(**data))
async def handle_state(self, data: dict[str, Any]) -> None: async def handle_state(self, data: dict[str, Any]) -> None:
""" """

View file

@ -73,7 +73,6 @@ from .config import (
) )
# TODO: ScrollableFrame
class OptionFrame(QWidget): class OptionFrame(QWidget):
def add_bool_option(self, name: str, description: str, value: bool = False) -> None: def add_bool_option(self, name: str, description: str, value: bool = False) -> None:
label = QLabel(description, self) label = QLabel(description, self)
@ -593,15 +592,10 @@ class SyngGui(QMainWindow):
self.qr_label = QLabel(self.qr_widget) self.qr_label = QLabel(self.qr_widget)
self.linklabel = QLabel(self.qr_widget) self.linklabel = QLabel(self.qr_widget)
# self.notification_label = QTextEdit(self.qr_widget)
# self.notification_label.setReadOnly(True)
# QLabel("", self.qr_widget)
self.qr_layout.addWidget(self.qr_label) self.qr_layout.addWidget(self.qr_label)
self.qr_layout.addWidget(self.linklabel) self.qr_layout.addWidget(self.linklabel)
# self.qr_layout.addWidget(self.notification_label)
self.qr_layout.setAlignment(self.linklabel, Qt.AlignmentFlag.AlignCenter) self.qr_layout.setAlignment(self.linklabel, Qt.AlignmentFlag.AlignCenter)
# self.qr_layout.setAlignment(self.notification_label, Qt.AlignmentFlag.AlignCenter)
self.qr_layout.setAlignment(self.qr_label, Qt.AlignmentFlag.AlignCenter) self.qr_layout.setAlignment(self.qr_label, Qt.AlignmentFlag.AlignCenter)
self.linklabel.setOpenExternalLinks(True) self.linklabel.setOpenExternalLinks(True)
@ -790,7 +784,6 @@ class SyngGui(QMainWindow):
config = self.gather_config() config = self.gather_config()
self.client = Client(config) self.client = Client(config)
asyncio.run_coroutine_threadsafe(self.client.start_client(config), self.loop) asyncio.run_coroutine_threadsafe(self.client.start_client(config), self.loop)
# self.notification_label.setText("")
self.timer.start(500) self.timer.start(500)
self.set_client_button_stop() self.set_client_button_stop()
else: else:
@ -847,7 +840,6 @@ class LoggingLabelHandler(logging.Handler):
def run_gui() -> None: def run_gui() -> None:
# initialize cache dir
os.makedirs(platformdirs.user_cache_dir("syng"), exist_ok=True) os.makedirs(platformdirs.user_cache_dir("syng"), exist_ok=True)
base_dir = os.path.dirname(__file__) base_dir = os.path.dirname(__file__)
if getattr(sys, "frozen", False) and hasattr(sys, "_MEIPASS"): if getattr(sys, "frozen", False) and hasattr(sys, "_MEIPASS"):

View file

@ -446,7 +446,6 @@ class Server:
state.sid, state.sid,
) )
state.client.config = DEFAULT_CONFIG | config state.client.config = DEFAULT_CONFIG | config
# await self.sio.emit("update_config", config, room)
except JSONDecodeError: except JSONDecodeError:
await self.sio.emit("err", {"type": "JSON_MALFORMED"}, room=sid) await self.sio.emit("err", {"type": "JSON_MALFORMED"}, room=sid)
@ -1310,8 +1309,6 @@ class Server:
# The internal loop counter does not use a regular timestamp, so we need to convert between # The internal loop counter does not use a regular timestamp, so we need to convert between
# regular datetime and the async loop time # regular datetime and the async loop time
now = datetime.datetime.now() now = datetime.datetime.now()
# today = datetime.datetime(now.year, now.month, now.day)
# next_run = today + datetime.timedelta(days=1)
next_run = now + datetime.timedelta(hours=1) next_run = now + datetime.timedelta(hours=1)
offset = next_run.timestamp() - now.timestamp() offset = next_run.timestamp() - now.timestamp()

View file

@ -27,8 +27,6 @@ from ..entry import Entry
from ..result import Result from ..result import Result
from ..config import BoolOption, ConfigOption from ..config import BoolOption, ConfigOption
# logger: logging.Logger = logging.getLogger(__name__)
class EntryNotValid(Exception): class EntryNotValid(Exception):
"""Raised when an entry is not valid for a source.""" """Raised when an entry is not valid for a source."""
@ -385,8 +383,6 @@ class Source(ABC):
logger.warning(f"{self.source_name}: done") logger.warning(f"{self.source_name}: done")
if new_index is not None: if new_index is not None:
self._index = new_index self._index = new_index
# chunked = zip_longest(*[iter(new_index)] * 1000, fillvalue="")
# return [{"index": list(filter(lambda x: x != "", chunk))} for chunk in chunked]
return await self.get_config() return await self.get_config()
return None return None