Fix failure with dataclasses under Python 3.11

This patch was submitted by https://gitlab.com/danhansen in an issue on
the bug tracker, and although I've tested it and endorse it, I wanted to
make it clear this isn't my code.

Signed-off-by: Louis-Philippe Véronneau <pollo@debian.org>
This commit is contained in:
danhansen
2022-12-01 14:33:14 -05:00
committed by Louis-Philippe Véronneau
parent 793ae50408
commit fd40be6809

View File

@@ -87,11 +87,12 @@ class UIState:
def __init__(self):
self.name = "Rock"
current_album_search_query: AlbumSearchQuery = AlbumSearchQuery(
AlbumSearchQuery.Type.RANDOM,
genre=_DefaultGenre(),
year_range=this_decade(),
)
current_album_search_query: AlbumSearchQuery = field(
default_factory = lambda: AlbumSearchQuery(
AlbumSearchQuery.Type.RANDOM,
genre=UIState._DefaultGenre(),
year_range=this_decade(),
))
active_playlist_id: Optional[str] = None