def METHOD_NAME(
    existing_user_listening_history, user_listening_history_dict_to_update
):
    for i, user_history in enumerate(existing_user_listening_history):
        track_to_latest_timestamp = {}
        track_to_play_count = DefaultDict(int)
        for existing_play in user_history.listening_history:
            track_to_latest_timestamp[existing_play["track_id"]] = existing_play[
                "timestamp"
            ]
            track_to_play_count[existing_play["track_id"]] = existing_play.get(
                "play_count", 1
            )
        for new_play in user_listening_history_dict_to_update[user_history.user_id]:
            current_max_timestamp = track_to_latest_timestamp.get(
                new_play["track_id"], str(datetime.min)
            )
            track_to_latest_timestamp[new_play["track_id"]] = max(
                current_max_timestamp, new_play["timestamp"]
            )
            track_to_play_count[new_play["track_id"]] += 1
        existing_user_listening_history[
            i
        ].listening_history = sort_listening_history_desc_by_timestamp(
            track_to_latest_timestamp, track_to_play_count
        )