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 +1 -1
- zou/app/blueprints/persons/resources.py +1 -1
- zou/app/blueprints/playlists/__init__.py +2 -0
- zou/app/blueprints/playlists/resources.py +50 -0
- zou/app/blueprints/user/resources.py +99 -81
- zou/app/models/notification.py +9 -1
- zou/app/services/emails_service.py +63 -19
- zou/app/services/news_service.py +1 -3
- zou/app/services/notifications_service.py +39 -2
- zou/app/services/template_services.py +129 -0
- zou/app/services/time_spents_service.py +3 -3
- zou/app/services/user_service.py +22 -5
- zou/app/utils/commands.py +1 -1
- zou/migrations/versions/0c05b22194f3_add_performance_indexes.py +35 -0
- zou/migrations/versions/5f1620d191af_add_playlist_id_field_to_notification.py +46 -0
- zou/migrations/versions/71d546ace0ee_add_performance_indexes.py +32 -0
- {zou-0.20.76.dist-info → zou-0.20.77.dist-info}/METADATA +4 -4
- {zou-0.20.76.dist-info → zou-0.20.77.dist-info}/RECORD +22 -18
- {zou-0.20.76.dist-info → zou-0.20.77.dist-info}/WHEEL +0 -0
- {zou-0.20.76.dist-info → zou-0.20.77.dist-info}/entry_points.txt +0 -0
- {zou-0.20.76.dist-info → zou-0.20.77.dist-info}/licenses/LICENSE +0 -0
- {zou-0.20.76.dist-info → zou-0.20.77.dist-info}/top_level.txt +0 -0
zou/__init__.py
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
__version__ = "0.20.
|
|
1
|
+
__version__ = "0.20.77"
|
|
@@ -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"}
|