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.
26 lines
968 B
26 lines
968 B
import json
|
|
from Orm import Video
|
|
from playhouse.shortcuts import model_to_dict, dict_to_model
|
|
|
|
|
|
class VideoService:
|
|
def getOneByVideoId(videoId):
|
|
return Video.get_or_none(Video.videoId == videoId)
|
|
|
|
def createOne(videoId, channelId, videoTitle, videoLen, videoType, videoPublishTime, videoLanguage, isDownload):
|
|
Video.create(videoId=videoId,
|
|
channelId=channelId,
|
|
videoTitle=videoTitle,
|
|
videoLen=videoLen,
|
|
videoType=videoType,
|
|
videoPublishTime=videoPublishTime,
|
|
videoLanguage=videoLanguage,
|
|
isDownload=isDownload)
|
|
|
|
def updateLenByVideoId(videoId, len):
|
|
Video.update(videoLen=len).where(Video.videoId == videoId).execute()
|
|
|
|
def updateIsDownloadByVideoId(videoId, isDownload):
|
|
Video.update(isDownload=isDownload).where(
|
|
Video.videoId == videoId).execute()
|
|
|