Esempio n. 1
0
    def get(self):
      
        tracks=memcache.get("front Videos playlists")
        if tracks is None:
            
            playlist=Playlist()
            playlist.tipo="predefined"
            
            playlist.create()
            tracks=playlist.getTracks()

            memcache.set("front Videos playlists",tracks)
        self.response.out.write(json.dumps(tracks))
Esempio n. 2
0
    def post(self):
        j=self.request.body
        data=json.loads(j)
        genre=data["data"]
        tracks=None
        tracks=memcache.get("%s Videos playlist"%genre)

        if tracks is None:
            playlist=Playlist()
            playlist.tipo="artist"
            playlist.param=data["data"]

            playlist.create()
            tracks=playlist.getTracks()

         
            memcache.set("%s Videos playlist"%genre, tracks)
        
        self.response.out.write(json.dumps(tracks))
Esempio n. 3
0
    def real_post(self):
        import time
        time_star=time.time()

        j=self.request.body
        data=json.loads(j)
        genre=data["data"]
        tracks=None
        tracks=memcache.get("%s Videos playlist"%genre)
        if tracks is None:

            playlist=Playlist()
            playlist.tipo="artist"
            playlist.param=data["data"]

            playlist.create()
            tracks=playlist.getTracks()
            memcache.set("%s Videos playlist"%genre, tracks)
        logging.error("total time of playlist= %s"%(time.time()-time.start()))
        self.response.out.write(json.dumps(tracks))
Esempio n. 4
0
    def post(self):
        logging.error("xhrCreateTagPlayList")
        j=self.request.body
        data=json.loads(j)
        genre=data["data"]
        
        tracks=None
  
        
        if tracks is None:

            playlist=Playlist()
            playlist.tipo="artist-radio"
            playlist.param=genre

            playlist.create()
            tracks={"tracks":playlist.getTracks(),"session":playlist.session}
  
          
           
        self.response.out.write(json.dumps(tracks))