Skip to content

Commit 664d2ea

Browse files
committed
Fix restoring Queue from cache
1 parent 4fc7168 commit 664d2ea

File tree

1 file changed

+2
-9
lines changed

1 file changed

+2
-9
lines changed

music_assistant_models/player_queue.py

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,12 @@
44

55
import time
66
from dataclasses import dataclass, field
7-
from typing import Any, Self
7+
from typing import Any
88

99
from mashumaro import DataClassDictMixin, field_options, pass_through
1010

1111
from .enums import PlaybackState, RepeatMode
12-
from .media_items import MediaItemType, media_from_dict
12+
from .media_items import MediaItemType
1313
from .queue_item import QueueItem
1414

1515

@@ -101,10 +101,3 @@ def to_cache(self) -> dict[str, Any]:
101101
# otherwise 'dont stop the music' will not work
102102
d["enqueued_media_items"] = [x.to_dict() for x in self.enqueued_media_items]
103103
return d
104-
105-
@classmethod
106-
def from_cache(cls, d: dict[Any, Any]) -> Self:
107-
"""Restore a PlayerQueue from a cache dict."""
108-
if "enqueued_media_items" in d:
109-
d["enqueued_media_items"] = [media_from_dict(x) for x in d["enqueued_media_items"]]
110-
return cls.from_dict(d)

0 commit comments

Comments
 (0)