def test_get_playlist_for_episode(self): self.generate_fixture_playlists() playlists = playlists_service.all_playlists_for_episode( self.project.id, self.episode_2.id ) self.assertEqual(len(playlists), 2) self.assertEqual(playlists[0]["name"], "Playlist 4") self.playlist.update({"for_client": True}) playlists = playlists_service.all_playlists_for_project( self.project.id, True ) self.assertEqual(len(playlists), 1) self.generate_fixture_playlist("Test main pack", for_entity="asset") self.generate_fixture_playlist( "Test all playlist", for_entity="asset", is_for_all=True ) playlists = playlists_service.all_playlists_for_episode( self.project.id, "main" ) self.assertEqual(len(playlists), 1) playlists = playlists_service.all_playlists_for_episode( self.project.id, "all" ) self.assertEqual(len(playlists), 1)
def get(self, project_id, episode_id): user_service.block_access_to_vendor() user_service.check_project_access(project_id) if episode_id not in ["main", "all"]: shots_service.get_episode(episode_id) return playlists_service.all_playlists_for_episode( project_id, episode_id, permissions.has_client_permissions())
def get(self, project_id, episode_id): user_service.check_project_access(project_id) if episode_id != "main": shots_service.get_episode(episode_id) return playlists_service.all_playlists_for_episode( project_id, episode_id, permissions.has_client_permissions() )
def test_get_playlist_for_episode(self): self.generate_fixture_playlist() playlists = playlists_service.all_playlists_for_episode( self.episode_2.id) self.assertEqual(len(playlists), 2) print(playlists) self.assertEqual(playlists[0]["name"], "Playlist 4") self.playlist.update({"for_client": True}) playlists = playlists_service.all_playlists_for_project( self.project.id, True) self.assertEqual(len(playlists), 1)
def get(self, project_id, episode_id): user_service.block_access_to_vendor() user_service.check_project_access(project_id) sort_by = self.get_sort_by() task_type_id = self.get_text_parameter("task_type_id") if episode_id not in ["main", "all"]: shots_service.get_episode(episode_id) return playlists_service.all_playlists_for_episode( project_id, episode_id, permissions.has_client_permissions(), sort_by=sort_by, task_type_id=task_type_id, )
def get(self, project_id, episode_id): """ Retrieve all playlists related to given episode. --- tags: - Playlists description: The full list is returned because the number of playlists in an episode is not that big. parameters: - in: path name: project_id required: True schema: type: UUID example: a24a6ea4-ce75-4665-a070-57453082c25 - in: path name: episode_id required: True schema: type: UUID example: a24a6ea4-ce75-4665-a070-57453082c25 responses: 200: description: All playlists related to given episode """ user_service.block_access_to_vendor() user_service.check_project_access(project_id) sort_by = self.get_sort_by() task_type_id = self.get_text_parameter("task_type_id") if episode_id not in ["main", "all"]: shots_service.get_episode(episode_id) return playlists_service.all_playlists_for_episode( project_id, episode_id, permissions.has_client_permissions(), sort_by=sort_by, task_type_id=task_type_id, )
def get(self, project_id, episode_id): user_service.check_project_access(project_id) shots_service.get_episode(episode_id) return playlists_service.all_playlists_for_episode(episode_id)
def test_get_playlist_for_episode(self): self.generate_fixture_playlist() playlists = playlists_service.all_playlists_for_episode( self.episode.id) self.assertEquals(len(playlists), 1) self.assertEquals(playlists[0]["name"], "Playlist 1")