Skip to content

Conversation

@Video-Nomad
Copy link
Contributor

@Video-Nomad Video-Nomad commented Jan 2, 2026

Changed main.py qasync init to proper one from this example and other related changes:

  • Initialize qasync loop immediately.
  • Fixes "no running loop" error in various __init__ scenarios.
  • Adjust controller.py exit and reload logic for qasync event.
  • Added custom QApplication subclass to hold loop and close_event.
  • CLI server adjustments to fix yasb hanging on exit.
  • Added QSingleton metaclass that works with QObjects.

WindowsMedia rewrite and optional on-widget progress bar:

  • Added optional progress bar to media widget + docs.
  • Progress bar can be aligned top, center or bottom. Can be styled from css.
  • Full rewrite of WindowsMedia client to use new qasync loop.
  • Partial refactor of media widget to use new dataclass from new WindowsMedia client.
  • Hide progress bar and progress slider if duration is too short (<=0) or too long (> 7 days).
  • Moved to dedicated logger in media widget.

Better session tracking:

  • Multiple sessions should now be properly synchronized even when switching between them.
  • All sessions are tracked so their playback position is stable.
  • YouTube and YouTube Music has a bug where they report stale data under some circumstances. Not related to YASB or Windows API.

Progress bar under the label:
image

Progress bar config example:

  media:
    options:
      progress_bar:
        enabled: true        # Whether to enable the progress bar on the widget.
        alignment: "bottom"  # The alignment of the progress bar inside the widget container. Can be "top", "bottom", or "center".

Styling example:

.media-widget .progress-bar {
    max-height: 2px;
    background-color: transparent;
    margin-left: 5px;
    border: none;
}

.media-widget .progress-bar::chunk {
    background-color: #0078D477;
    border-radius: 2px;
}

Additional notes:
Due to the change in main.py init, closing the app is now done by setting the asyncio event:

app = QApplication.instance()
if isinstance(app, YASBApplication):
    if app.loop and app.close_event:
        app.loop.call_soon_threadsafe(app.close_event.set)

- Initialize qasync loop immediately.
- Fixes "no running loop" error in various `__init__` scenarios.
- Adjust controller.py exit and reload logic for qasync event.
- Added custom QApplication subclass to hold `loop` and `close_event`.
- CLI server adjustments to fix yasb hanging on exit.
- Added QSingleton metaclass that works with QObjects.
- Typing fixes.
@Video-Nomad Video-Nomad force-pushed the feat/media-rewrite-and-progress-bar branch from a44c8bc to 2fec21a Compare January 2, 2026 13:11
- Added optional progress bar to media widget.
- Progress bar can be aligned top, center or bottom.
- Full rewrite of WindowsMedia client to use new qasync loop.
- Partial refactor of media widget to use new dataclass from new WindowsMedia client.
- Hide progress bar and progress slider if duration is too low (<=0) or too big (> 7 days).
- Moved to dedicated logger in media widget.
- Some typing adjustments.
@Video-Nomad Video-Nomad force-pushed the feat/media-rewrite-and-progress-bar branch from 2fec21a to 7252eb2 Compare January 2, 2026 16:11
@amnweb amnweb merged commit 46bfc29 into amnweb:main Jan 2, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants