@gen.coroutine
def SavePhotos(client, obj_store, user_id, device_id, request):
 request['user_id'] = user_id
 (yield Activity.VerifyActivityId(client, user_id, device_id, request['activity']['activity_id']))
 vp_ids = request.get('viewpoint_ids', [])
 ep_dicts = request.get('episodes', [])
 num_photos = 0
 for ep_dict in ep_dicts:
  (yield Episode.VerifyEpisodeId(client, user_id, device_id, ep_dict['new_episode_id']))
  num_photos += len(ep_dict['photo_ids'])
 (yield gen.Task(Operation.CreateAndExecute, client, user_id, device_id, 'SavePhotosOperation.Execute', request))
 logging.info(('SAVE PHOTOS: user: %d, device: %d, %d viewpoints, %d episodes, %d photos' % (user_id, device_id, len(vp_ids), len(ep_dicts), num_photos)))
 raise gen.Return({})

@ gen . coroutine def SavePhotos ( client , obj_store , user_id , device_id , request ) : request [ 'user_id' ] = user_id ( yield Activity . VerifyActivityId ( client , user_id , device_id , request [ 'activity' ] [ 'activity_id' ] ) ) vp_ids = request . get ( 'viewpoint_ids' , [ ] ) ep_dicts = request . get ( 'episodes' , [ ] ) num_photos = 0 for ep_dict in ep_dicts : ( yield Episode . VerifyEpisodeId ( client , user_id , device_id , ep_dict [ 'new_episode_id' ] ) ) num_photos += len ( ep_dict [ 'photo_ids' ] ) ( yield gen . Task ( Operation . CreateAndExecute , client , user_id , device_id , 'SavePhotosOperation.Execute' , request ) ) logging . info ( ( 'SAVE PHOTOS: user: %d, device: %d, %d viewpoints, %d episodes, %d photos' % ( user_id , device_id , len ( vp_ids ) , len ( ep_dicts ) , num_photos ) ) ) raise gen . Return ( { } )
saves photos from existing episodes to new episodes in the current users default viewpoint .