artemis-model 0.1.104__tar.gz → 0.1.106__tar.gz
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-0.1.104 → artemis_model-0.1.106}/PKG-INFO +1 -1
- artemis_model-0.1.106/artemis_model/banned_tracks.py +21 -0
- {artemis_model-0.1.104 → artemis_model-0.1.106}/artemis_model/redis/bucket.py +6 -7
- {artemis_model-0.1.104 → artemis_model-0.1.106}/pyproject.toml +1 -1
- {artemis_model-0.1.104 → artemis_model-0.1.106}/README.md +0 -0
- {artemis_model-0.1.104 → artemis_model-0.1.106}/artemis_model/__init__.py +0 -0
- {artemis_model-0.1.104 → artemis_model-0.1.106}/artemis_model/album.py +0 -0
- {artemis_model-0.1.104 → artemis_model-0.1.106}/artemis_model/artist.py +0 -0
- {artemis_model-0.1.104 → artemis_model-0.1.106}/artemis_model/auth.py +0 -0
- {artemis_model-0.1.104 → artemis_model-0.1.106}/artemis_model/base.py +0 -0
- {artemis_model-0.1.104 → artemis_model-0.1.106}/artemis_model/category.py +0 -0
- {artemis_model-0.1.104 → artemis_model-0.1.106}/artemis_model/dj_set.py +0 -0
- {artemis_model-0.1.104 → artemis_model-0.1.106}/artemis_model/genre.py +0 -0
- {artemis_model-0.1.104 → artemis_model-0.1.106}/artemis_model/location.py +0 -0
- {artemis_model-0.1.104 → artemis_model-0.1.106}/artemis_model/message.py +0 -0
- {artemis_model-0.1.104 → artemis_model-0.1.106}/artemis_model/organization.py +0 -0
- {artemis_model-0.1.104 → artemis_model-0.1.106}/artemis_model/otp.py +0 -0
- {artemis_model-0.1.104 → artemis_model-0.1.106}/artemis_model/permission.py +0 -0
- {artemis_model-0.1.104 → artemis_model-0.1.106}/artemis_model/playlist.py +0 -0
- {artemis_model-0.1.104 → artemis_model-0.1.106}/artemis_model/redis/__init__.py +0 -0
- {artemis_model-0.1.104 → artemis_model-0.1.106}/artemis_model/redis/device.py +0 -0
- {artemis_model-0.1.104 → artemis_model-0.1.106}/artemis_model/redis/keys.py +0 -0
- {artemis_model-0.1.104 → artemis_model-0.1.106}/artemis_model/redis/play_history.py +0 -0
- {artemis_model-0.1.104 → artemis_model-0.1.106}/artemis_model/redis/zone_state.py +0 -0
- {artemis_model-0.1.104 → artemis_model-0.1.106}/artemis_model/schedule.py +0 -0
- {artemis_model-0.1.104 → artemis_model-0.1.106}/artemis_model/setting.py +0 -0
- {artemis_model-0.1.104 → artemis_model-0.1.106}/artemis_model/sqs/__init__.py +0 -0
- {artemis_model-0.1.104 → artemis_model-0.1.106}/artemis_model/sqs/messages.py +0 -0
- {artemis_model-0.1.104 → artemis_model-0.1.106}/artemis_model/track.py +0 -0
- {artemis_model-0.1.104 → artemis_model-0.1.106}/artemis_model/user.py +0 -0
- {artemis_model-0.1.104 → artemis_model-0.1.106}/artemis_model/zone.py +0 -0
@@ -0,0 +1,21 @@
|
|
1
|
+
"""Banned Tracks per Zone Model"""
|
2
|
+
|
3
|
+
from sqlalchemy import UUID, Column, Integer
|
4
|
+
|
5
|
+
from artemis_model.base import AuditMixin, TimeStampMixin, CustomSyncBase, CustomBase
|
6
|
+
|
7
|
+
|
8
|
+
class BannedTracksMixin(TimeStampMixin, AuditMixin):
|
9
|
+
"""Banned Tracks per Zone Model"""
|
10
|
+
zone_id: int = Column(Integer, primary_key=True)
|
11
|
+
track_id: UUID = Column(UUID(as_uuid=True), primary_key=True)
|
12
|
+
|
13
|
+
|
14
|
+
class BannedTracksSync(CustomSyncBase, BannedTracksMixin):
|
15
|
+
"""Banned Tracks per Zone Model"""
|
16
|
+
pass
|
17
|
+
|
18
|
+
|
19
|
+
class BannedTracks(CustomBase, BannedTracksMixin):
|
20
|
+
"""Banned Tracks per Zone Model"""
|
21
|
+
pass
|
@@ -47,13 +47,6 @@ class RedisTrackBucketItem(BaseModel):
|
|
47
47
|
key = self.model_dump_json(include={"track_id", "playlist_id"})
|
48
48
|
return {key: self.ts}
|
49
49
|
|
50
|
-
def as_redis_str(self) -> str:
|
51
|
-
"""
|
52
|
-
Generate a Redis-ready string:
|
53
|
-
'{{"track_id": "...", "playlist_id": ...}': ts}'
|
54
|
-
"""
|
55
|
-
key = self.model_dump_json(include={"track_id", "playlist_id"})
|
56
|
-
return f"{{{key}: {self.ts}}}"
|
57
50
|
|
58
51
|
@classmethod
|
59
52
|
def from_redis_entry(cls, entry: dict[str, int]) -> "RedisTrackBucketItem":
|
@@ -61,3 +54,9 @@ class RedisTrackBucketItem(BaseModel):
|
|
61
54
|
Parse a Redis entry into a RedisTrackBucketItem.
|
62
55
|
"""
|
63
56
|
return cls.model_validate_json(list(entry.keys())[0])
|
57
|
+
|
58
|
+
|
59
|
+
class RedisTrackBucketItemValue(BaseModel):
|
60
|
+
"""JSON string format for Redis keys: '{"track_id": "...", "playlist_id": ...}'"""
|
61
|
+
track_id: TrackId
|
62
|
+
playlist_id: PlaylistId
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|