def get_duration_of_items(items):
    """
    Calculate the total duration of the media items using the "length" attribute
    """
    total_time = 0
    if isinstance(items, list):
        for item in items:
            try:
                length = item.get('length')
                if not length or length <= 0:
                    raise ValueError('Invalid length value!')
                total_time += length
            except TypeError:
                pass
            except ValueError:
                pass
    return round(total_time)
