You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

23 lines
834 B

from entity.SrtFileEntity import Srtfile
from common.Utils import getSession
from sqlalchemy import update
class SrtFileService:
def checkExistsByVideoId(videoid):
session = getSession()
srtFile: Srtfile = session.query(Srtfile).filter(
Srtfile.videoId == videoid).first()
session.close()
if srtFile is not None:
return True
else:
return False
def insertOne(videoId, channelId, ordinal, srtStartTime, srtEndTime, srtText, isScan):
session = getSession()
srtFile: Srtfile = Srtfile(videoId=videoId, channelId=channelId, ordinal=ordinal, srtStartTime=srtStartTime,
srtEndTime=srtEndTime, srtText=srtText, isScan=isScan)
session.add(srtFile)
session.commit()
session.close()