feat: Add playlist management functionality and compliance checks

- Introduced a new "Playlists" column in results view with visual indicators for membership.
- Added `playlist_api.py` to handle playlist-related operations (fetch, add, remove tracks).
- Implemented `PlaylistManagerDialog` for seamless playlist addition/removal with caching.
- Integrated compliance check script (`check_agents_compliance.py`) for ensuring coding standards.
- Added extensive documentation (`playlist_membership_manager.md`) covering architecture and flow.
- Updated GUI logic and QStandardItemModel setup to include playlist data.
- Included unit tests for playlist management components and API.
This commit is contained in:
Warry
2025-12-29 17:37:39 +01:00
parent 75868b32d0
commit 296c6c7d6b
17 changed files with 3433 additions and 4 deletions
+28
View File
@@ -47,6 +47,30 @@ class QtHandler(logging.Handler):
XStream.stdout().write("%s\n" % record)
# --- Verbosity control -------------------------------------------------------
# If False: DEBUG and WARNING messages are suppressed (INFO/ERROR/CRITICAL shown).
# If True: DEBUG and WARNING messages are shown.
_VERBOSE_DEBUG = False
class DebugWarningFilter(logging.Filter):
def filter(self, record: logging.LogRecord) -> bool:
# Always allow INFO (and above except WARNING handled below)
# Suppress DEBUG and WARNING when _VERBOSE_DEBUG is False
if not _VERBOSE_DEBUG and record.levelno in (logging.DEBUG, logging.WARNING):
return False
return True
def enable_debug_and_warnings(enabled: bool = True):
"""Enable/disable showing DEBUG and WARNING log records globally.
INFO/ERROR/CRITICAL are unaffected and always shown.
"""
global _VERBOSE_DEBUG
_VERBOSE_DEBUG = bool(enabled)
logger_gui = logging.getLogger(__name__)
handler_qt: QtHandler = QtHandler()
# log_fmt: str = "[%(asctime)s] %(levelname)s: %(message)s"
@@ -57,6 +81,8 @@ level_styles = coloredlogs.DEFAULT_LEVEL_STYLES.copy()
level_styles["info"] = {"color": "green"}
formatter = coloredlogs.ColoredFormatter(fmt=log_fmt, level_styles=level_styles)
handler_qt.setFormatter(formatter)
# Apply filter to control DEBUG/WARNING visibility
handler_qt.addFilter(DebugWarningFilter())
logger_gui.addHandler(handler_qt)
logger_gui.setLevel(logging.DEBUG)
@@ -64,5 +90,7 @@ logger_cli = logging.getLogger(__name__)
handler_stream: logging.StreamHandler = logging.StreamHandler()
formatter = coloredlogs.ColoredFormatter(fmt=log_fmt, level_styles=level_styles)
handler_stream.setFormatter(formatter)
# Apply filter to control DEBUG/WARNING visibility
handler_stream.addFilter(DebugWarningFilter())
logger_cli.addHandler(handler_stream)
logger_cli.setLevel(logging.DEBUG)