from Orm import SrtFile class SrtService: def createOne(videoId, channelId, ordinal, srtStartTime, srtEndTime, srtText): SrtFile.create(videoId=videoId, channelId=channelId, ordinal=ordinal, srtStartTime=srtStartTime, srtEndTime=srtEndTime, srtText=srtText, isScan=0) def checkByVideoId(videoId): list = SrtFile.select().where(SrtFile.videoId == videoId).limit(10).execute() return len(list) > 0