예제 #1
0
파일: music.py 프로젝트: nandittiku/MyMusic
 def songinfo(self, songID):
     """
     View lastfm info about a song
     @param songID
     """
     c.song = musicDB.findsong(songID)
     return render("/derived/music/lastfm.html")
예제 #2
0
파일: music.py 프로젝트: nandittiku/MyMusic
 def songinfo(self, songID):
     """
     View lastfm info about a song
     @param songID
     """
     c.song = musicDB.findsong(songID)
     return render("/derived/music/lastfm.html")
예제 #3
0
파일: music.py 프로젝트: nandittiku/MyMusic
 def listen(self, songID):
     """
     Generate a stream for the music that is requested.
     Since the songs are outsite the webservers control area
     we need to load the music into a stream and return the
     stream.
     @param songID - ID of the song to stream.
     @return content - The music stream.
     """
     songID = re.sub('\.mp3$', '', songID)
     path = musicDB.findsong(songID).path
     stream = open(path)
     content = stream.read()
     stream.close()
     response.content_type = "audio/mpeg"
     response.content_length = len(content)
     return content
예제 #4
0
파일: music.py 프로젝트: nandittiku/MyMusic
 def listen(self, songID):
     """
     Generate a stream for the music that is requested.
     Since the songs are outsite the webservers control area
     we need to load the music into a stream and return the
     stream.
     @param songID - ID of the song to stream.
     @return content - The music stream.
     """
     songID = re.sub('\.mp3$', '', songID)
     path = musicDB.findsong(songID).path
     stream = open(path)
     content = stream.read()
     stream.close()
     response.content_type = "audio/mpeg"
     response.content_length = len(content)
     return content