fix comments

This commit is contained in:
jxxghp
2023-06-26 11:51:54 +08:00
parent 0fd26dc708
commit 178ac334a0
13 changed files with 151 additions and 1 deletions

View File

@ -9,21 +9,33 @@ class DownloadHistory(Base):
下载历史记录
"""
id = Column(Integer, Sequence('id'), primary_key=True, index=True)
# 保存路径
path = Column(String, nullable=False, index=True)
# 类型 电影/电视剧
type = Column(String, nullable=False)
# 标题
title = Column(String, nullable=False)
# 年份
year = Column(String)
tmdbid = Column(Integer, index=True)
imdbid = Column(String)
tvdbid = Column(Integer)
doubanid = Column(String)
# Sxx
seasons = Column(Integer)
# Exx
episodes = Column(String)
# 海报
image = Column(String)
# 下载任务Hash
download_hash = Column(String, index=True)
# 种子名称
torrent_name = Column(String)
# 种子描述
torrent_description = Column(String)
# 种子站点
torrent_site = Column(String)
# 附加信息
note = Column(String)
@staticmethod

View File

@ -11,21 +11,37 @@ class Site(Base):
站点表
"""
id = Column(Integer, Sequence('id'), primary_key=True, index=True)
# 站点名
name = Column(String, nullable=False)
# 域名Key
domain = Column(String, index=True)
# 站点地址
url = Column(String, nullable=False)
# 站点优先级
pri = Column(Integer)
# RSS地址未启用
rss = Column(String)
# Cookie
cookie = Column(String)
# User-Agent
ua = Column(String)
# 是否使用代理 0-否1-是
proxy = Column(Integer)
# 过滤规则
filter = Column(String)
# 是否渲染
render = Column(Integer)
# 附加信息
note = Column(String)
# 流控单位周期
limit_interval = Column(Integer, default=0)
# 流控次数
limit_count = Column(Integer, default=0)
# 流控间隔
limit_seconds = Column(Integer, default=0)
# 是否启用
is_active = Column(Boolean(), default=True)
# 创建时间
lst_mod_date = Column(String, default=datetime.now().strftime("%Y-%m-%d %H:%M:%S"))
@staticmethod

View File

@ -9,9 +9,13 @@ class SiteIcon(Base):
站点图标表
"""
id = Column(Integer, Sequence('id'), primary_key=True, index=True)
# 站点名称
name = Column(String, nullable=False)
# 域名Key
domain = Column(String, index=True)
# 图标地址
url = Column(String, nullable=False)
# 图标Base64
base64 = Column(String)
@staticmethod

View File

@ -9,24 +9,39 @@ class Subscribe(Base):
订阅表
"""
id = Column(Integer, Sequence('id'), primary_key=True, index=True)
# 标题
name = Column(String, nullable=False, index=True)
# 年份
year = Column(String)
# 类型
type = Column(String)
# 搜索关键字
keyword = Column(String)
tmdbid = Column(Integer, index=True)
imdbid = Column(String)
tvdbid = Column(Integer, index=True)
doubanid = Column(String)
# 季号
season = Column(Integer)
# 海报
image = Column(String)
# 简介
description = Column(String)
# 过滤规则
filter = Column(String)
# 包含
include = Column(String)
# 排除
exclude = Column(String)
# 总集数
total_episode = Column(Integer)
# 开始集数
start_episode = Column(Integer)
# 缺失集数
lack_episode = Column(Integer)
# 附加信息
note = Column(String)
# 状态N-新建, R-订阅中
state = Column(String, nullable=False, index=True, default='N')
@staticmethod

View File

@ -9,7 +9,9 @@ class SystemConfig(Base):
配置表
"""
id = Column(Integer, Sequence('id'), primary_key=True, index=True)
# 主键
key = Column(String, index=True)
# 值
value = Column(String, nullable=True)
@staticmethod

View File

@ -1,6 +1,6 @@
import time
from sqlalchemy import Column, Integer, String, Sequence
from sqlalchemy import Column, Integer, String, Sequence, Boolean
from sqlalchemy.orm import Session
from app.db.models import Base
@ -11,21 +11,37 @@ class TransferHistory(Base):
转移历史记录
"""
id = Column(Integer, Sequence('id'), primary_key=True, index=True)
# 源目录
src = Column(String, index=True)
# 目标目录
dest = Column(String)
# 转移模式 move/copy/link...
mode = Column(String)
# 类型 电影/电视剧
type = Column(String)
# 二级分类
category = Column(String)
# 标题
title = Column(String, index=True)
# 年份
year = Column(String)
tmdbid = Column(Integer)
imdbid = Column(String)
tvdbid = Column(Integer)
doubanid = Column(String)
# Sxx
seasons = Column(Integer)
# Exx
episodes = Column(String)
# 海报
image = Column(String)
# 下载器hash
download_hash = Column(String)
# 转移成功状态
status = Column(Boolean(), default=True)
# 转移失败信息
errmsg = Column(String)
# 时间
date = Column(String, index=True, default=time.strftime("%Y-%m-%d %H:%M:%S", time.localtime()))
@staticmethod

View File

@ -9,12 +9,19 @@ class User(Base):
"""
用户表
"""
# ID
id = Column(Integer, Sequence('id'), primary_key=True, index=True)
# 用户名
name = Column(String, index=True, nullable=False)
# 邮箱,未启用
email = Column(String, unique=True, index=True)
# 加密后密码
hashed_password = Column(String, nullable=False)
# 是否启用
is_active = Column(Boolean(), default=True)
# 是否管理员
is_superuser = Column(Boolean(), default=False)
# 头像
avatar = Column(String)
@staticmethod