示例#1
0
def home():
    current, playlist = music.get_playlist()
    playlist = [Song.query.filter_by(id=pk).first() for pk in playlist]
    current = Song.query.filter_by(id=current).first()
    form = PostAlbumForm()
    return render_template('home.html', form=form, current=current,
                           playlist=playlist, played=music.get_time())
示例#2
0
 def on_current_request(self):
     current, playlist = get_playlist()
     current = Song.query.filter_by(id=current).first()
     sketchy_ctx = app.test_request_context()
     sketchy_ctx.push()
     self.emit('current_data', render_template('current_bar.html', current=current, played=music.get_time()))
     sketchy_ctx.pop()
示例#3
0
 def on_current_request(self):
     """
     Returns the html for the current song, ready to plop into
     the music player."""
     current, playlist = get_playlist()
     current = Song.query.filter_by(id=current).first()
     sketchy_ctx = app.test_request_context()
     sketchy_ctx.push()
     self.emit('current_data', render_template('current_bar.html', current=current, played=music.get_time()))
     sketchy_ctx.pop()