artemis-model 0.1.132__tar.gz → 0.1.134__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.
Files changed (32) hide show
  1. {artemis_model-0.1.132 → artemis_model-0.1.134}/PKG-INFO +1 -1
  2. {artemis_model-0.1.132 → artemis_model-0.1.134}/artemis_model/category.py +7 -13
  3. {artemis_model-0.1.132 → artemis_model-0.1.134}/artemis_model/redis/zone_state.py +2 -2
  4. {artemis_model-0.1.132 → artemis_model-0.1.134}/pyproject.toml +1 -1
  5. {artemis_model-0.1.132 → artemis_model-0.1.134}/README.md +0 -0
  6. {artemis_model-0.1.132 → artemis_model-0.1.134}/artemis_model/__init__.py +0 -0
  7. {artemis_model-0.1.132 → artemis_model-0.1.134}/artemis_model/album.py +0 -0
  8. {artemis_model-0.1.132 → artemis_model-0.1.134}/artemis_model/artist.py +0 -0
  9. {artemis_model-0.1.132 → artemis_model-0.1.134}/artemis_model/auth.py +0 -0
  10. {artemis_model-0.1.132 → artemis_model-0.1.134}/artemis_model/banned_tracks.py +0 -0
  11. {artemis_model-0.1.132 → artemis_model-0.1.134}/artemis_model/base.py +0 -0
  12. {artemis_model-0.1.132 → artemis_model-0.1.134}/artemis_model/dj_set.py +0 -0
  13. {artemis_model-0.1.132 → artemis_model-0.1.134}/artemis_model/genre.py +0 -0
  14. {artemis_model-0.1.132 → artemis_model-0.1.134}/artemis_model/location.py +0 -0
  15. {artemis_model-0.1.132 → artemis_model-0.1.134}/artemis_model/message.py +0 -0
  16. {artemis_model-0.1.132 → artemis_model-0.1.134}/artemis_model/organization.py +0 -0
  17. {artemis_model-0.1.132 → artemis_model-0.1.134}/artemis_model/otp.py +0 -0
  18. {artemis_model-0.1.132 → artemis_model-0.1.134}/artemis_model/permission.py +0 -0
  19. {artemis_model-0.1.132 → artemis_model-0.1.134}/artemis_model/playlist.py +0 -0
  20. {artemis_model-0.1.132 → artemis_model-0.1.134}/artemis_model/redis/__init__.py +0 -0
  21. {artemis_model-0.1.132 → artemis_model-0.1.134}/artemis_model/redis/bucket.py +0 -0
  22. {artemis_model-0.1.132 → artemis_model-0.1.134}/artemis_model/redis/device.py +0 -0
  23. {artemis_model-0.1.132 → artemis_model-0.1.134}/artemis_model/redis/keys.py +0 -0
  24. {artemis_model-0.1.132 → artemis_model-0.1.134}/artemis_model/redis/play_history.py +0 -0
  25. {artemis_model-0.1.132 → artemis_model-0.1.134}/artemis_model/schedule.py +0 -0
  26. {artemis_model-0.1.132 → artemis_model-0.1.134}/artemis_model/setting.py +0 -0
  27. {artemis_model-0.1.132 → artemis_model-0.1.134}/artemis_model/sqs/__init__.py +0 -0
  28. {artemis_model-0.1.132 → artemis_model-0.1.134}/artemis_model/sqs/messages.py +0 -0
  29. {artemis_model-0.1.132 → artemis_model-0.1.134}/artemis_model/track.py +0 -0
  30. {artemis_model-0.1.132 → artemis_model-0.1.134}/artemis_model/user.py +0 -0
  31. {artemis_model-0.1.132 → artemis_model-0.1.134}/artemis_model/zone.py +0 -0
  32. {artemis_model-0.1.132 → artemis_model-0.1.134}/artemis_model/zone_activity.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: artemis-model
3
- Version: 0.1.132
3
+ Version: 0.1.134
4
4
  Summary:
5
5
  Author: Jukeboxy
6
6
  Requires-Python: >=3.10.6,<4.0.0
@@ -1,4 +1,4 @@
1
- from sqlalchemy import ARRAY, Computed, String, func, literal, text
1
+ from sqlalchemy import Computed, String, func, literal, text
2
2
  from sqlalchemy.ext.associationproxy import AssociationProxy, association_proxy
3
3
  from sqlalchemy.orm import Mapped, mapped_column, relationship
4
4
 
@@ -16,12 +16,12 @@ def to_tsvector_ix(*columns):
16
16
 
17
17
  class CategoryMixin(TimeStampMixin):
18
18
  id: Mapped[int] = mapped_column(primary_key=True)
19
- name: Mapped[str] = mapped_column(nullable=False)
20
- sub_categories: Mapped[list[str]] = mapped_column(ARRAY(String), default=[])
19
+ main_category: Mapped[str] = mapped_column(nullable=False)
20
+ sub_category: Mapped[str] = mapped_column(nullable=False)
21
21
 
22
22
  name_tsv = mapped_column(
23
23
  TSVector(),
24
- Computed("to_tsvector('english', name)", persisted=True),
24
+ Computed("to_tsvector('english', main_category || ' ' || sub_category)", persisted=True),
25
25
  )
26
26
 
27
27
  @declared_attr
@@ -35,26 +35,20 @@ class CategoryMixin(TimeStampMixin):
35
35
  "playlist",
36
36
  creator=lambda p: PlaylistCategoryAssoc(playlist_id=p),
37
37
  )
38
+
38
39
 
39
40
  # __table_args__ = (
40
41
  # Index(
41
42
  # "fts_ix_category_name_tsv",
42
- # to_tsvector_ix("name"),
43
+ # to_tsvector_ix("main_category", "sub_category"),
43
44
  # postgresql_using="gin",
44
45
  # ),
45
46
  # )
46
47
 
47
- @property
48
- def is_subcategory(self) -> bool:
49
- if self.sub_categories:
50
- return True
51
-
52
- return False
53
-
54
48
 
55
49
  class CategorySync(CustomSyncBase, CategoryMixin):
56
50
  pass
57
51
 
58
52
 
59
53
  class Category(CustomBase, CategoryMixin):
60
- pass
54
+ pass
@@ -43,9 +43,9 @@ class PlaylistSimple(BaseModel):
43
43
  class ScheduleDetails(BaseModel):
44
44
  """Schedule details schema."""
45
45
 
46
- start_ts_utc: int | str |None = Field(
46
+ start_at: datetime | None = Field(
47
47
  default=None,
48
- description="The start timestamp of the schedule in UTC",
48
+ description="The date and time value of the schedule in local timezone.",
49
49
  )
50
50
  playlists: list[PlaylistSimple] | None = Field(
51
51
  default=None,
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "artemis-model"
3
- version = "0.1.132"
3
+ version = "0.1.134"
4
4
  description = ""
5
5
  authors = ["Jukeboxy"]
6
6
  readme = "README.md"