artemis-model 0.1.113__tar.gz → 0.1.115__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.113 → artemis_model-0.1.115}/PKG-INFO +1 -1
- {artemis_model-0.1.113 → artemis_model-0.1.115}/artemis_model/sqs/messages.py +11 -0
- {artemis_model-0.1.113 → artemis_model-0.1.115}/artemis_model/zone_activity.py +18 -0
- {artemis_model-0.1.113 → artemis_model-0.1.115}/pyproject.toml +1 -1
- {artemis_model-0.1.113 → artemis_model-0.1.115}/README.md +0 -0
- {artemis_model-0.1.113 → artemis_model-0.1.115}/artemis_model/__init__.py +0 -0
- {artemis_model-0.1.113 → artemis_model-0.1.115}/artemis_model/album.py +0 -0
- {artemis_model-0.1.113 → artemis_model-0.1.115}/artemis_model/artist.py +0 -0
- {artemis_model-0.1.113 → artemis_model-0.1.115}/artemis_model/auth.py +0 -0
- {artemis_model-0.1.113 → artemis_model-0.1.115}/artemis_model/banned_tracks.py +0 -0
- {artemis_model-0.1.113 → artemis_model-0.1.115}/artemis_model/base.py +0 -0
- {artemis_model-0.1.113 → artemis_model-0.1.115}/artemis_model/category.py +0 -0
- {artemis_model-0.1.113 → artemis_model-0.1.115}/artemis_model/dj_set.py +0 -0
- {artemis_model-0.1.113 → artemis_model-0.1.115}/artemis_model/genre.py +0 -0
- {artemis_model-0.1.113 → artemis_model-0.1.115}/artemis_model/location.py +0 -0
- {artemis_model-0.1.113 → artemis_model-0.1.115}/artemis_model/message.py +0 -0
- {artemis_model-0.1.113 → artemis_model-0.1.115}/artemis_model/organization.py +0 -0
- {artemis_model-0.1.113 → artemis_model-0.1.115}/artemis_model/otp.py +0 -0
- {artemis_model-0.1.113 → artemis_model-0.1.115}/artemis_model/permission.py +0 -0
- {artemis_model-0.1.113 → artemis_model-0.1.115}/artemis_model/playlist.py +0 -0
- {artemis_model-0.1.113 → artemis_model-0.1.115}/artemis_model/redis/__init__.py +0 -0
- {artemis_model-0.1.113 → artemis_model-0.1.115}/artemis_model/redis/bucket.py +0 -0
- {artemis_model-0.1.113 → artemis_model-0.1.115}/artemis_model/redis/device.py +0 -0
- {artemis_model-0.1.113 → artemis_model-0.1.115}/artemis_model/redis/keys.py +0 -0
- {artemis_model-0.1.113 → artemis_model-0.1.115}/artemis_model/redis/play_history.py +0 -0
- {artemis_model-0.1.113 → artemis_model-0.1.115}/artemis_model/redis/zone_state.py +0 -0
- {artemis_model-0.1.113 → artemis_model-0.1.115}/artemis_model/schedule.py +0 -0
- {artemis_model-0.1.113 → artemis_model-0.1.115}/artemis_model/setting.py +0 -0
- {artemis_model-0.1.113 → artemis_model-0.1.115}/artemis_model/sqs/__init__.py +0 -0
- {artemis_model-0.1.113 → artemis_model-0.1.115}/artemis_model/track.py +0 -0
- {artemis_model-0.1.113 → artemis_model-0.1.115}/artemis_model/user.py +0 -0
- {artemis_model-0.1.113 → artemis_model-0.1.115}/artemis_model/zone.py +0 -0
@@ -10,6 +10,8 @@ from artemis_model.redis.zone_state import SessionId
|
|
10
10
|
from artemis_model.schedule import ScheduleItem
|
11
11
|
from pydantic import BaseModel, Field
|
12
12
|
|
13
|
+
from artemis_model.zone_activity import ZoneActivityType
|
14
|
+
|
13
15
|
|
14
16
|
class Action(str, Enum):
|
15
17
|
"""Message type enum."""
|
@@ -101,3 +103,12 @@ class BanTrackIn(BaseMessage):
|
|
101
103
|
zone_id: int
|
102
104
|
track_id: UUID
|
103
105
|
playlist_id: int
|
106
|
+
|
107
|
+
|
108
|
+
class ZoneActivityIn(BaseMessage):
|
109
|
+
"""Zone activity message schema."""
|
110
|
+
|
111
|
+
action: Action = Action.ZONE_ACTIVITY
|
112
|
+
zone_id: int
|
113
|
+
activity_type: ZoneActivityType
|
114
|
+
activity_data: dict
|
@@ -1,10 +1,28 @@
|
|
1
1
|
"""Zone Activity Model"""
|
2
2
|
|
3
|
+
from enum import StrEnum
|
3
4
|
from sqlalchemy import Integer, String, JSON, Index
|
4
5
|
from sqlalchemy.orm import Mapped, mapped_column
|
5
6
|
from artemis_model.base import AuditMixin, TimeStampMixin, CustomSyncBase, CustomBase
|
6
7
|
|
7
8
|
|
9
|
+
class ZoneActivityType(StrEnum):
|
10
|
+
"""Zone activity type"""
|
11
|
+
|
12
|
+
CONNECTED = "connected"
|
13
|
+
CONNECTION_MODE_CHANGED = "connection_mode_changed"
|
14
|
+
DISCONNECTED = "disconnected"
|
15
|
+
PLAYER_PAUSED = "player_paused"
|
16
|
+
PLAYER_RESUMED = "player_resumed"
|
17
|
+
TRACK_SKIPPED = "track_skipped"
|
18
|
+
TRACK_LIKED = "track_liked"
|
19
|
+
TRACK_BANNED = "track_banned"
|
20
|
+
TRACK_UNBANNED = "track_unbanned"
|
21
|
+
PLAYLIST_PUSHED = "playlist_pushed"
|
22
|
+
PLAYLIST_EXPIRED = "playlist_expired"
|
23
|
+
ACTIVE_PLAYLIST_CHANGED = "active_playlist_changed"
|
24
|
+
|
25
|
+
|
8
26
|
class PlayerActivityMixin(TimeStampMixin, AuditMixin):
|
9
27
|
"""User activity log, sorted by created_at DESC for retrieval"""
|
10
28
|
|
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
|
File without changes
|