コード例 #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