@gen.coroutine
def OldRemovePhotos(client, obj_store, user_id, device_id, request):
  """Used by older clients to remove photos from showing in a user's personal library. Unlike
  the new remove_photos, photos can be removed from shared viewpoints as well as the default
  viewpoint. Photos are hidden in shared viewpoints, and removed from the default viewpoint.
  """
  remove_episodes = []
  hide_episodes = []
  for ep_dict in request['episodes']:
    episode = yield gen.Task(Episode.Query, client, ep_dict['episode_id'], None, must_exist=False)
    if episode is None or episode.viewpoint_id == base.ViewfinderContext.current().user.private_vp_id:
      # Episodes from the user's default viewpoint should be removed.
      remove_episodes.append(ep_dict)
    else:
      # Episodes from other viewpoints should be hidden.
      hide_episodes.append(ep_dict)

  hide_request = deepcopy(request)
  if len(hide_episodes) > 0:
    hide_request['episodes'] = hide_episodes
    yield HidePhotos(client, obj_store, user_id, device_id, hide_request)

  remove_request = deepcopy(request)
  remove_request['episodes'] = remove_episodes
  yield RemovePhotos(client, obj_store, user_id, device_id, remove_request)

  raise gen.Return({})
dataset/ETHPy150Open viewfinderco/viewfinder/backend/www/service.py/OldRemovePhotos/original