zou 0.20.76__py3-none-any.whl → 0.20.77__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.
zou/__init__.py CHANGED
@@ -1 +1 @@
1
- __version__ = "0.20.76"
1
+ __version__ = "0.20.77"
@@ -1527,7 +1527,7 @@ class ClearAvatarPersonResource(Resource):
1527
1527
  file.
1528
1528
  ---
1529
1529
  tags:
1530
- - User
1530
+ - Persons
1531
1531
  responses:
1532
1532
  204:
1533
1533
  description: Avatar file deleted
@@ -7,6 +7,7 @@ from zou.app.blueprints.playlists.resources import (
7
7
  BuildPlaylistMovieResource,
8
8
  EntityPreviewsResource,
9
9
  EpisodePlaylistsResource,
10
+ NotifyClientsResource,
10
11
  ProjectPlaylistsResource,
11
12
  ProjectAllPlaylistsResource,
12
13
  ProjectBuildJobsResource,
@@ -44,6 +45,7 @@ routes = [
44
45
  PlaylistZipDownloadResource,
45
46
  ),
46
47
  ("/data/projects/<project_id>/playlists/temp", TempPlaylistResource),
48
+ ("/data/playlists/<playlist_id>/notify-clients", NotifyClientsResource),
47
49
  ]
48
50
 
49
51
  blueprint = Blueprint("playlists", "playlists")
@@ -9,6 +9,7 @@ from zou.app.mixin import ArgsMixin
9
9
 
10
10
  from zou.app.services import (
11
11
  entities_service,
12
+ notifications_service,
12
13
  playlists_service,
13
14
  persons_service,
14
15
  preview_files_service,
@@ -722,3 +723,52 @@ class TempPlaylistResource(Resource, ArgsMixin):
722
723
  return (
723
724
  playlists_service.generate_temp_playlist(task_ids, sort=sort) or []
724
725
  )
726
+
727
+
728
+ class NotifyClientsResource(Resource, ArgsMixin):
729
+
730
+ @jwt_required()
731
+ def post(self, playlist_id):
732
+ """
733
+ Notify clients that given playlist is ready.
734
+
735
+ ---
736
+ tags:
737
+ - Playlists
738
+ parameters:
739
+ - in: path
740
+ name: playlist_id
741
+ required: true
742
+ schema:
743
+ type: string
744
+ format: uuid
745
+ example: a24a6ea4-ce75-4665-a070-57453082c25
746
+ requestBody:
747
+ required: true
748
+ content:
749
+ application/json:
750
+ schema:
751
+ type: object
752
+ properties:
753
+ studio_id:
754
+ type: string
755
+ format: uuid
756
+ example: a24a6ea4-ce75-4665-a070-57453082c25
757
+ responses:
758
+ '200':
759
+ description: Clients notified
760
+ content:
761
+ application/json:
762
+ schema:
763
+ type: object
764
+ properties:
765
+ status:
766
+ type: string
767
+ example: success
768
+ """
769
+ studio_id = request.json.get("studio_id", None)
770
+ playlist = playlists_service.get_playlist(playlist_id)
771
+ project_id = playlist["project_id"]
772
+ user_service.check_manager_project_access(project_id)
773
+ notifications_service.notify_clients_playlist_ready(playlist, studio_id)
774
+ return {"status": "success"}