You've already forked my-video-workflow
初始版本
This commit is contained in:
@ -1,3 +1,5 @@
|
||||
import os
|
||||
|
||||
from . import db
|
||||
|
||||
|
||||
@ -5,16 +7,18 @@ 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"))
|
||||
|
||||
@property
|
||||
def full_path(self):
|
||||
return os.path.abspath(os.path.join(self.base_path, self.file))
|
||||
|
||||
def to_json(self):
|
||||
return {
|
||||
"id": self.id,
|
||||
"base_path": self.base_path,
|
||||
"file": self.file,
|
||||
"subtitle_file": self.subtitle_file,
|
||||
"offset": self.offset,
|
||||
}
|
||||
|
Reference in New Issue
Block a user