def AddNewAudio(self,blobkey,audioname,videoLink,composer,composeremail,starttime,language,uniqueID): vid = Video.query(Video.videolink == videoLink) v = vid.get() v.dubsCount = int(v.dubsCount) +1 v.put() recordedAudiosList = [] # if(uniqueID != ""): # userQuery=User.query(ancestor=self.UserKey(uniqueID)) # user = userQuery.get() # response = dict() # if(user != None): # recordedAudiosList = user.recordedAudios # recordedAudiosList.append(blobkey) # user.put() audioKey=blobkey aud = Audio(parent=self.AudioLink(videoLink)) aud.audiolink = audioKey aud.videolink = videoLink aud.name = audioname aud.audioblobkey = audioKey aud.upvotes = 0 aud.downvotes=0 aud.composer = composer aud.composerEmail=composeremail aud.recordeddate = datetime.now() aud.starttime = starttime aud.language = language aud.viewCount = 0 aud.put() post = dict() post["result"] = audioKey return json.dumps(post)
def AddNewAudio(self, blobkeys, audioname, videoLink, composer, composeremail, starttime, language): # logging.info(str(blob)) vid = Video.query(Video.videolink == videoLink) v = vid.get() v.dubsCount = int(v.dubsCount) + 1 v.put() audioKeys = blobkeys aud = Audio(parent=self.AudioLink(videoLink)) aud.audiolink = audioKeys[0] aud.videolink = videoLink aud.name = audioname aud.audioblobkey = audioKeys aud.upvotes = 0 aud.downvotes = 0 aud.composer = composer aud.composerEmail = composeremail aud.recordeddate = datetime.now() aud.starttime = starttime aud.language = language aud.viewCount = 0 aud.put() post = dict() post["result"] = audioKeys return json.dumps(post)