예제 #1
0
    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)
예제 #2
0
    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)
예제 #3
0
    def AddNewAudio(self, audioname, audioLink, videoLink, composer, composeremail, starttime, language, uniqueID):
       
        vid = Video.query(Video.videolink == videoLink)
        v = vid.get()
        v.dubsCount = int(v.dubsCount) + 1
        v.put()

        # Generating a new UUID as the audio link
        aud = Audio(parent=self.AudioLink(videoLink))
        aud.audiolink = audioLink
        aud.videolink = videoLink
        aud.name = audioname
        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"] = audioLink
        return json.dumps(post)