def serialize_file_list(files: list, active_item_index: int = -1):
    """Returns a serialized file list, which JRiver requires in some API calls.
    These are a not documented further, but form a string of comma seperated values.
    These are, in order:
    [0] The value '2', stating a serialization version. Only 2 is supported these days.
    [1] The number of included keys
    [2] The active element (?), -1 for none
    [3]..[len(files + 3)]: The keys of the files.
    """
    result = "2;" + str(len(files)) + ";" + str(active_item_index)
    for file in files:
        result += ";" + str(file["Key"])
    return result