初次提交

This commit is contained in:
2022-04-15 12:26:43 +08:00
commit 09b2956573
30 changed files with 952 additions and 0 deletions

20
model/DanmakuClip.py Normal file
View File

@ -0,0 +1,20 @@
from . import db
class DanmakuClip(db.Model):
id = db.Column(db.Integer, primary_key=True, autoincrement=True)
base_path = db.Column(db.String(255))
file = db.Column(db.String(255))
subtitle_file = db.Column(db.String(255))
offset = db.Column(db.Float, nullable=False, default=0)
workflow_id = db.Column(db.Integer, db.ForeignKey('workflow.id'))
workflow = db.relationship("Workflow", backref=db.backref("danmaku_clips", lazy="dynamic"))
def to_json(self):
return {
"id": self.id,
"base_path": self.base_path,
"file": self.file,
"subtitle_file": self.subtitle_file,
"offset": self.offset,
}