优化播放被打断的问题
This commit is contained in:
parent
d271f7b0f7
commit
474fea8434
@ -71,6 +71,12 @@ def playingmusic():
|
|||||||
return xiaomusic.playingmusic()
|
return xiaomusic.playingmusic()
|
||||||
|
|
||||||
|
|
||||||
|
@app.route("/isplaying", methods=["GET"])
|
||||||
|
@auth.login_required
|
||||||
|
def isplaying():
|
||||||
|
return xiaomusic.isplaying()
|
||||||
|
|
||||||
|
|
||||||
@app.route("/", methods=["GET"])
|
@app.route("/", methods=["GET"])
|
||||||
def index():
|
def index():
|
||||||
return send_from_directory("static", "index.html")
|
return send_from_directory("static", "index.html")
|
||||||
|
@ -269,6 +269,9 @@ class XiaoMusic:
|
|||||||
except Exception as e:
|
except Exception as e:
|
||||||
self.log.error(f"Execption {e}")
|
self.log.error(f"Execption {e}")
|
||||||
pass
|
pass
|
||||||
|
if self._playing:
|
||||||
|
# 继续播放歌曲
|
||||||
|
await self.play()
|
||||||
|
|
||||||
async def do_set_volume(self, value):
|
async def do_set_volume(self, value):
|
||||||
value = int(value)
|
value = int(value)
|
||||||
@ -534,7 +537,7 @@ class XiaoMusic:
|
|||||||
return ("stop", {})
|
return ("stop", {})
|
||||||
return (None, None)
|
return (None, None)
|
||||||
|
|
||||||
# 判断是否播放一下私募歌曲
|
# 判断是否播放下一首歌曲
|
||||||
def check_play_next(self):
|
def check_play_next(self):
|
||||||
# 当前没我在播放的歌曲
|
# 当前没我在播放的歌曲
|
||||||
if self.cur_music == "":
|
if self.cur_music == "":
|
||||||
@ -619,7 +622,6 @@ class XiaoMusic:
|
|||||||
# 刷新列表
|
# 刷新列表
|
||||||
async def gen_music_list(self, **kwargs):
|
async def gen_music_list(self, **kwargs):
|
||||||
self._gen_all_music_list()
|
self._gen_all_music_list()
|
||||||
await self.do_tts("生成播放列表完毕")
|
|
||||||
|
|
||||||
# 删除歌曲
|
# 删除歌曲
|
||||||
def del_music(self, name):
|
def del_music(self, name):
|
||||||
@ -712,6 +714,10 @@ class XiaoMusic:
|
|||||||
self.log.debug("playingmusic. cur_music:%s", self.cur_music)
|
self.log.debug("playingmusic. cur_music:%s", self.cur_music)
|
||||||
return self.cur_music
|
return self.cur_music
|
||||||
|
|
||||||
|
# 当前是否正在播放歌曲
|
||||||
|
def isplaying(self):
|
||||||
|
return self._playing
|
||||||
|
|
||||||
# 获取当前配置
|
# 获取当前配置
|
||||||
def getconfig(self):
|
def getconfig(self):
|
||||||
return self.config
|
return self.config
|
||||||
|
Loading…
Reference in New Issue
Block a user