Skip to content
Merged
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
19 changes: 19 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,22 @@
<!-- 0.26.0 -->

# Changes

❗Important: PySide requires us to change how settings are stored. This will be the last
release that can read the legacy settings, and it will migrate them automatically.
If you skip this release, some settings may be lost.

## Fixes

- The webserver's `/api/songs` endpoint has been fixed.

## Features

- Dimensions and aspect ratio of downloaded image files are now tracked. If enabled in
the settings, they are taken into account when sorting on the cover or background
column, appear in the tooltip on hover, and their quality is indicated by new icons
(most detailed in the system theme.)

<!-- 0.25.0 -->

# Changes
Expand Down
2 changes: 1 addition & 1 deletion src/usdb_syncer/gui/search_tree/item.py
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ def _update_after_child_toggled(

def apply_search(self, search: db.SearchBuilder) -> list[TreeItem]:
changed = []
if self.children:
if self.data.is_parent():
for child in self.children:
before = child.checked
changed.extend(child.apply_search(search))
Expand Down
11 changes: 10 additions & 1 deletion src/usdb_syncer/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
import functools
import json
import os
import re
import sys
import threading
from enum import Enum, StrEnum, auto
Expand All @@ -18,6 +19,7 @@

import attrs
import keyring
import PySide6
import yt_dlp.cookies
from PySide6.QtCore import QByteArray, QSettings

Expand Down Expand Up @@ -1557,8 +1559,15 @@ def migrate_settings_to_schema_12() -> None:

As of 0.25.0, we stored custom types in QSettings which got pickled by PySide6.
But starting with 6.12, PySide throws a RuntimeError for these types. So we load
all of the affected settings and rewrite them with in the new format once.
all of the affected settings and rewrite them in the new format once.
"""
match = re.match("(\\d+)\\.(\\d+)\\.(\\d+)", PySide6.__version__)
if match is None or (int(match[1]) >= 6 and int(match[2]) >= 12):
logger.warning(
f"Cannot migrate legacy settings with PySide {PySide6.__version__}; "
"some settings may be lost."
)
return
to_migrate: list[tuple[Callable[[], Any], Callable[[Any, bool], None]]] = [
(get_ytdlp_rate_limit, set_ytdlp_rate_limit),
(get_audio_format, set_audio_format),
Expand Down
5 changes: 2 additions & 3 deletions src/usdb_syncer/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ def extract_vimeo_id(url: str) -> str | None:
(?:vimeo\.com/)
(?:video/)?
(\d{2,9}) # the actual id
(?:[%#?&]|$) # URL may contain additonal parameters
(?:[%#?&]|$) # URL may contain additional parameters
.*
"""
if match := re.search(pattern, url, re.VERBOSE | re.IGNORECASE):
Expand All @@ -202,8 +202,7 @@ def read_file_head(
) -> list[str] | None:
"""Return the first `length` lines of `path`.

If `encoding` is None, try UTF-8 (with
BOM) first, then cp1252.
If `encoding` is None, try UTF-8 (with BOM) first, then cp1252.
"""
for enc in [encoding] if encoding else ["utf-8-sig", "cp1252"]:
try:
Expand Down
Loading