artemis-model 0.1.101__py3-none-any.whl → 0.1.102__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
artemis_model/redis/bucket.py
CHANGED
@@ -1,4 +1,5 @@
|
|
1
1
|
"""Redis track buckets"""
|
2
|
+
import json
|
2
3
|
from pydantic import BaseModel, Field, ConfigDict
|
3
4
|
from typing import Annotated
|
4
5
|
from datetime import datetime, timezone
|
@@ -46,6 +47,13 @@ class RedisTrackBucketItem(BaseModel):
|
|
46
47
|
key = self.model_dump_json(include={"track_id", "playlist_id"})
|
47
48
|
return {key: self.ts}
|
48
49
|
|
50
|
+
def as_redis_str(self) -> str:
|
51
|
+
"""
|
52
|
+
Generate a Redis-ready string:
|
53
|
+
{ '{"track_id": "...", "playlist_id": ...}': ts }
|
54
|
+
"""
|
55
|
+
return json.dumps(self.as_redis_entry())
|
56
|
+
|
49
57
|
@classmethod
|
50
58
|
def from_redis_entry(cls, entry: dict[str, int]) -> "RedisTrackBucketItem":
|
51
59
|
"""
|
@@ -13,7 +13,7 @@ artemis_model/otp.py,sha256=guIRGtyFlHUBthCAEsTh5_Hs-1yiGN_qfEO4uHNcv4s,1017
|
|
13
13
|
artemis_model/permission.py,sha256=Bn1Bg1aCS4Z4_3tqEqvtrzqAYDCImsvmGyIEMoVycEk,1452
|
14
14
|
artemis_model/playlist.py,sha256=L22KSJgTZmNEc9CqM3TFD4Wnx3TW77GQJ5EFLJCxZ20,6393
|
15
15
|
artemis_model/redis/__init__.py,sha256=qwAtvh2NrxRsjk_MqdeTZDwoaGc1K4PZhCCdTDsSTvA,781
|
16
|
-
artemis_model/redis/bucket.py,sha256=
|
16
|
+
artemis_model/redis/bucket.py,sha256=9KM4ie0pdZVYlDb3V8qdHnGtsImZ-bUFmSJHKfJMKT0,1630
|
17
17
|
artemis_model/redis/device.py,sha256=ZUiIyVmtWiEwayFIg9mktiFaVuHQ7Fg0rvSjjWyryCI,484
|
18
18
|
artemis_model/redis/keys.py,sha256=bnlSaBCIakLCIlgTr8BlYJmKEtKKvtdr43QIJCLnc90,567
|
19
19
|
artemis_model/redis/play_history.py,sha256=pLWDpDlqZCH2bXTW-H0RFddJjXXmvobvIBm9iTUVy4k,1278
|
@@ -25,6 +25,6 @@ artemis_model/sqs/messages.py,sha256=98cWxrj48T1AcEnltqVGTts6rcmTYimeN8fC6wkdNQk
|
|
25
25
|
artemis_model/track.py,sha256=QwUF0QKVn1I64648B-NI75-IzGQvnLt9B0emD4GnS6E,3757
|
26
26
|
artemis_model/user.py,sha256=eqIdCiBJRNLjCwPPCn-gQ6si0O5JUBGfp9oWJL5zVW4,2131
|
27
27
|
artemis_model/zone.py,sha256=iGRUtzUwKh9LHT3MOfzzg1DnkPBts_ZBzZVTi2EmIgs,2282
|
28
|
-
artemis_model-0.1.
|
29
|
-
artemis_model-0.1.
|
30
|
-
artemis_model-0.1.
|
28
|
+
artemis_model-0.1.102.dist-info/METADATA,sha256=9awyatoTdrCs6sZ2ZmXP-cusBt6UfqvN3yRnwH8mTws,3445
|
29
|
+
artemis_model-0.1.102.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
|
30
|
+
artemis_model-0.1.102.dist-info/RECORD,,
|