import json


def loop_casts(casts: list) -> dict:
    """Loop all casts and remove duplicates by putting them into a dict using
    the first timestamp as a key in timeseries list

    :param casts: list of paths
    :return: dict of casts as dict
    """
    by_start_time = dict()
    for now_c in casts:
        with open(now_c) as f:
            cast = json.load(f)
            start_time = cast["properties"]["timeseries"][0]["time"]
            by_start_time[start_time] = cast
    return by_start_time