def get_current_song_path(session_id=0): try: path_ = alsaplayer.get_file_path(session_id) return path_.replace('//', '/') except Exception as e: app.logger.error(e) pass
def get_album_art(session_id=0): # jpeg_byte_string = None mime_ = 'image/png' # try: images = get_metadata(alsaplayer.get_file_path(session_id)).tag.images if len(images) > 0: jpeg_byte_string = images[0].image_data mime_ = images[0].mime_type else: raise Exception('no album art') # except Exception as e: # app.logger.error(e) # jpeg_byte_string = open('flaskapp/static/images/no_album_art.png', 'r').read() return jpeg_byte_string, mime_