def delete_stream_info_by_date(db: Session, name: str, date: time.struct_time) -> int:
    """根据 streamer 和开播时间删除下载信息, 返回删除的行数, 若不存在则返回 0 """
    start_datetime = struct_time_to_datetime(date)
    stmt = delete(StreamerInfo).where(
        (StreamerInfo.name == name),
        StreamerInfo.date.between(
            start_datetime - timedelta(minutes=1),
            start_datetime + timedelta(minutes=1)),
    )
    result = db.execute(stmt)
    db.commit()
    return result.rowcount()
根据 streamer 和开播时间删除下载信息, 返回删除的行数, 若不存在则返回 0
biliup/database/db.py