artemis-model 0.1.146__py3-none-any.whl → 0.1.148__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.

Potentially problematic release.


This version of artemis-model might be problematic. Click here for more details.

artemis_model/__init__.py CHANGED
@@ -5,6 +5,7 @@ from artemis_model.category import * # noqa
5
5
  from artemis_model.dj_set import * # noqa
6
6
  from artemis_model.genre import * # noqa
7
7
  from artemis_model.location import * # noqa
8
+ from artemis_model.location_genre_exclusion import * # noqa
8
9
  from artemis_model.message import * # noqa
9
10
  from artemis_model.organization import * # noqa
10
11
  from artemis_model.playlist import * # noqa
artemis_model/location.py CHANGED
@@ -86,6 +86,14 @@ class LocationMixin(TimeStampMixin):
86
86
  cascade="all, delete-orphan",
87
87
  )
88
88
 
89
+ @declared_attr
90
+ def genre_exclusions(cls) -> Mapped[list["LocationGenreExclusion"]]:
91
+ return relationship(
92
+ "LocationGenreExclusion",
93
+ back_populates="location",
94
+ cascade="all, delete-orphan",
95
+ )
96
+
89
97
  timezone: Mapped[str] = mapped_column(nullable=False, default="America/New_York")
90
98
 
91
99
 
@@ -0,0 +1,38 @@
1
+ import uuid
2
+ from sqlalchemy import ForeignKey, UniqueConstraint
3
+ from sqlalchemy.orm import Mapped, mapped_column, relationship
4
+ from sqlalchemy.ext.declarative import declared_attr
5
+
6
+ from artemis_model.base import TimeStampMixin, CustomSyncBase, CustomBase
7
+
8
+
9
+ class LocationGenreExclusionMixin(TimeStampMixin):
10
+ """Association table for tracking which genres are excluded at the location level."""
11
+
12
+ id: Mapped[int] = mapped_column(primary_key=True, autoincrement=True)
13
+ location_id: Mapped[uuid.UUID] = mapped_column(
14
+ ForeignKey("location.id", ondelete="CASCADE"), nullable=False, index=True
15
+ )
16
+ genre_id: Mapped[int] = mapped_column(
17
+ ForeignKey("genre.id", ondelete="CASCADE"), nullable=False, index=True
18
+ )
19
+
20
+ @declared_attr
21
+ def location(cls) -> Mapped["Location"]:
22
+ return relationship(back_populates="genre_exclusions")
23
+
24
+ @declared_attr
25
+ def genre(cls) -> Mapped["Genre"]:
26
+ return relationship()
27
+
28
+ __table_args__ = (
29
+ UniqueConstraint("location_id", "genre_id", name="unique_location_genre_exclusion"),
30
+ )
31
+
32
+
33
+ class LocationGenreExclusionSync(CustomSyncBase, LocationGenreExclusionMixin):
34
+ pass
35
+
36
+
37
+ class LocationGenreExclusion(CustomBase, LocationGenreExclusionMixin):
38
+ pass
@@ -66,12 +66,10 @@ class PushPlaylistIn(BaseMessage):
66
66
  action: Action = Action.PUSH_PLAYLIST
67
67
  zone_id: int
68
68
  playlist_ids: list[int]
69
+ bucket_ts: BucketTS
69
70
  expire_at: datetime | None = Field(
70
71
  default=None, description="The datetime that the playlist will expire"
71
72
  )
72
- bucket_ts: BucketTS = Field(
73
- default_factory=lambda: int(datetime.now(timezone.utc).timestamp()),
74
- )
75
73
 
76
74
 
77
75
  class PushPlaylistExpireIn(BaseMessage):
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: artemis-model
3
- Version: 0.1.146
3
+ Version: 0.1.148
4
4
  Summary:
5
5
  Author: Jukeboxy
6
6
  Requires-Python: >=3.10.6,<4.0.0
@@ -1,4 +1,4 @@
1
- artemis_model/__init__.py,sha256=zEeAUndIbJdp_M6pFlON_BEehnMaMcTvusijGktpnvk,792
1
+ artemis_model/__init__.py,sha256=Ejibc6nk_vwWCPqRZirhof2Y2t-zeaYvOWyXJLUZsTg,853
2
2
  artemis_model/album.py,sha256=9uw9HVNHVBjl-0Dgv-o5MHXhUPwedvbnbzzY3A1cKQg,2077
3
3
  artemis_model/artist.py,sha256=vjXlFN2mOEidAzUzxmsAP5GnVTvJUuhFdhQaH214lgw,1563
4
4
  artemis_model/auth.py,sha256=0Yg_6N1nj4U31F86u1PE0leIa3D64QlYrsDlavulN6s,4033
@@ -7,7 +7,8 @@ artemis_model/base.py,sha256=zC20m8a1Sa11oEY0ay1iIRQeybGYvXY5p3Vr-pxoKnQ,6802
7
7
  artemis_model/category.py,sha256=ERZC8YBTtmF72ykSiVEtf_Ws3mPuN28ECfTxWF7H8tE,1662
8
8
  artemis_model/dj_set.py,sha256=fOYnCu4n5TiqyiSojfdFnO7LuPe_mM2SUwBV5xHy2Kc,3782
9
9
  artemis_model/genre.py,sha256=8_-IuJS543wIhUVCES3bdrDpKPKx-plDuBKGBcoMIbc,1570
10
- artemis_model/location.py,sha256=-ovGxYAajdQxNoQvafUBynSgcrdBklynXM7Qe7gmY5c,4645
10
+ artemis_model/location.py,sha256=6Z99OCxhB3VQ4CqNwZP3ShnJ-gOnc5rxGnCn5aCIFZ8,4896
11
+ artemis_model/location_genre_exclusion.py,sha256=SMX4TXmpwn28tytUq7-qP9ZyJ_ULs5SUv4h7sU0dRFo,1252
11
12
  artemis_model/message.py,sha256=W4vhllsD4Nn11JIKeXlgsKC2NWCt3UMkWh-Sma71gBI,3325
12
13
  artemis_model/organization.py,sha256=yjGHJLTOtb9PUfxSPal782Rceb8xb8vftXX67tHRNqc,2351
13
14
  artemis_model/otp.py,sha256=guIRGtyFlHUBthCAEsTh5_Hs-1yiGN_qfEO4uHNcv4s,1017
@@ -22,11 +23,11 @@ artemis_model/redis/zone_state.py,sha256=2ITvK40NcI1gEXu7ImnT05HeqU2-ep2gFoD-oH_
22
23
  artemis_model/schedule.py,sha256=CkLHWz-BwvUY2EQCfoU4SymgCariPzoQdtRLITqBPmk,2451
23
24
  artemis_model/setting.py,sha256=EWzOmE31mLNWwmV_wmqttHPMycvQZW7SJUIozF2b8bo,1190
24
25
  artemis_model/sqs/__init__.py,sha256=nHpXQns64qQ5Cqjyo6w9fDGO_wWhprqn1bhKf3eWnio,17
25
- artemis_model/sqs/messages.py,sha256=VVgjofwFkO9XhBKK64OiD3vEySex613HWWz3Xv0STe0,2989
26
+ artemis_model/sqs/messages.py,sha256=AfCiD2-xHAzr_uUFiuLJlbZ2JJeztZq2RE_0wKNvrl0,2898
26
27
  artemis_model/track.py,sha256=QwUF0QKVn1I64648B-NI75-IzGQvnLt9B0emD4GnS6E,3757
27
28
  artemis_model/user.py,sha256=eqIdCiBJRNLjCwPPCn-gQ6si0O5JUBGfp9oWJL5zVW4,2131
28
29
  artemis_model/zone.py,sha256=iGRUtzUwKh9LHT3MOfzzg1DnkPBts_ZBzZVTi2EmIgs,2282
29
30
  artemis_model/zone_activity.py,sha256=BY4iODavY9ceJ5oRChdjjxf26S3U30Yb7Pxm5YRFpCo,1590
30
- artemis_model-0.1.146.dist-info/METADATA,sha256=WlIqdM6C2vsOrptsswJh9r0HpHjcdSUxbHpkkCXc0Ow,3445
31
- artemis_model-0.1.146.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
32
- artemis_model-0.1.146.dist-info/RECORD,,
31
+ artemis_model-0.1.148.dist-info/METADATA,sha256=rzxZwL6haqnmDmoARazFKxNkJ9hqnccEWmbV2Sf09sc,3445
32
+ artemis_model-0.1.148.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
33
+ artemis_model-0.1.148.dist-info/RECORD,,