artemis-model 0.1.133__py3-none-any.whl → 0.1.135__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/category.py CHANGED
@@ -1,4 +1,4 @@
1
- from sqlalchemy import ARRAY, Computed, String, func, literal, text
1
+ from sqlalchemy import Computed, 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
@@ -39,18 +39,11 @@ class CategoryMixin(TimeStampMixin):
39
39
  # __table_args__ = (
40
40
  # Index(
41
41
  # "fts_ix_category_name_tsv",
42
- # to_tsvector_ix("name"),
42
+ # to_tsvector_ix("main_category", "sub_category"),
43
43
  # postgresql_using="gin",
44
44
  # ),
45
45
  # )
46
46
 
47
- @property
48
- def is_subcategory(self) -> bool:
49
- if self.sub_categories:
50
- return True
51
-
52
- return False
53
-
54
47
 
55
48
  class CategorySync(CustomSyncBase, CategoryMixin):
56
49
  pass
artemis_model/playlist.py CHANGED
@@ -1,7 +1,7 @@
1
1
  import uuid
2
2
  from datetime import date, datetime
3
3
 
4
- from sqlalchemy import Computed, ForeignKey, func, literal, text
4
+ from sqlalchemy import Computed, ForeignKey, func, literal, text, ARRAY, String
5
5
  from sqlalchemy.ext.hybrid import hybrid_property
6
6
  from sqlalchemy.ext.associationproxy import AssociationProxy, association_proxy
7
7
  from sqlalchemy.orm import Mapped, mapped_column, relationship
@@ -43,6 +43,8 @@ class PlaylistMixin(TimeStampMixin):
43
43
  published_at: Mapped[date | None] = mapped_column(nullable=True)
44
44
  is_private: Mapped[bool] = mapped_column(default=False)
45
45
  total_duration: Mapped[int] = mapped_column(default=0)
46
+ track_count: Mapped[int] = mapped_column(default=0)
47
+ artist_names: Mapped[list[str]] = mapped_column(ARRAY(String), nullable=False, default=[])
46
48
 
47
49
  name_tsv = mapped_column(
48
50
  TSVector(),
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: artemis-model
3
- Version: 0.1.133
3
+ Version: 0.1.135
4
4
  Summary:
5
5
  Author: Jukeboxy
6
6
  Requires-Python: >=3.10.6,<4.0.0
@@ -4,7 +4,7 @@ artemis_model/artist.py,sha256=vjXlFN2mOEidAzUzxmsAP5GnVTvJUuhFdhQaH214lgw,1563
4
4
  artemis_model/auth.py,sha256=0Yg_6N1nj4U31F86u1PE0leIa3D64QlYrsDlavulN6s,4033
5
5
  artemis_model/banned_tracks.py,sha256=uU-F-6DL2EshPAUwLTTHjYZ7UEz4vm0Wfcif2F0lSKw,664
6
6
  artemis_model/base.py,sha256=zC20m8a1Sa11oEY0ay1iIRQeybGYvXY5p3Vr-pxoKnQ,6802
7
- artemis_model/category.py,sha256=jhCZrK-LxPmc0pXmVifAZWdCENssBTzdTmC3nqqZc6s,1761
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
10
  artemis_model/location.py,sha256=-ovGxYAajdQxNoQvafUBynSgcrdBklynXM7Qe7gmY5c,4645
@@ -12,7 +12,7 @@ artemis_model/message.py,sha256=W4vhllsD4Nn11JIKeXlgsKC2NWCt3UMkWh-Sma71gBI,3325
12
12
  artemis_model/organization.py,sha256=yjGHJLTOtb9PUfxSPal782Rceb8xb8vftXX67tHRNqc,2351
13
13
  artemis_model/otp.py,sha256=guIRGtyFlHUBthCAEsTh5_Hs-1yiGN_qfEO4uHNcv4s,1017
14
14
  artemis_model/permission.py,sha256=Bn1Bg1aCS4Z4_3tqEqvtrzqAYDCImsvmGyIEMoVycEk,1452
15
- artemis_model/playlist.py,sha256=L22KSJgTZmNEc9CqM3TFD4Wnx3TW77GQJ5EFLJCxZ20,6393
15
+ artemis_model/playlist.py,sha256=O60zlP1LrDkzNrrfNA7TD_kotd5A9i8PuFhwonXFhN0,6559
16
16
  artemis_model/redis/__init__.py,sha256=CEQ4Vy3lwSlW_Q66nFLGevJr3nRv8Ema59PG0pG6q9I,944
17
17
  artemis_model/redis/bucket.py,sha256=DlmIf6GxfKq9CzcXmMx5IcviaqOTvuWwIb6lAVcZQGs,1537
18
18
  artemis_model/redis/device.py,sha256=ZUiIyVmtWiEwayFIg9mktiFaVuHQ7Fg0rvSjjWyryCI,484
@@ -27,6 +27,6 @@ artemis_model/track.py,sha256=QwUF0QKVn1I64648B-NI75-IzGQvnLt9B0emD4GnS6E,3757
27
27
  artemis_model/user.py,sha256=eqIdCiBJRNLjCwPPCn-gQ6si0O5JUBGfp9oWJL5zVW4,2131
28
28
  artemis_model/zone.py,sha256=iGRUtzUwKh9LHT3MOfzzg1DnkPBts_ZBzZVTi2EmIgs,2282
29
29
  artemis_model/zone_activity.py,sha256=BY4iODavY9ceJ5oRChdjjxf26S3U30Yb7Pxm5YRFpCo,1590
30
- artemis_model-0.1.133.dist-info/METADATA,sha256=ouIOKMFLGpN1YJ3ZotW2ndqO-U3cYY8kAigu1p2Ibv8,3445
31
- artemis_model-0.1.133.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
32
- artemis_model-0.1.133.dist-info/RECORD,,
30
+ artemis_model-0.1.135.dist-info/METADATA,sha256=kcyxO1oNUACB9TMb7DzxvC71iefPlzvO7RobMqAQItE,3445
31
+ artemis_model-0.1.135.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
32
+ artemis_model-0.1.135.dist-info/RECORD,,