def SortShareEpDicts(ep_dicts):
 ep_dicts.sort(key=(lambda episode: episode['new_episode_id']), reverse=True)
 for episode in ep_dicts:
  episode['photo_ids'].sort()

def SortShareEpDicts ( ep_dicts ) : ep_dicts . sort ( key = ( lambda episode : episode [ 'new_episode_id' ] ) , reverse = True ) for episode in ep_dicts : episode [ 'photo_ids' ] . sort ( )
cover_photo selection depends on episode/photo order in share_new and share_existing .