Skip to content

Commit

Permalink
🐛 修复部分问题
Browse files Browse the repository at this point in the history
  • Loading branch information
Mai-icy committed May 26, 2022
1 parent f107f45 commit c406493
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions MusicTager/api/cloud_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ def get_song_info(self, song_id: str) -> SongInfo:
:return: Filtered song information in dict.
"""
res_json = requests.post(self._song_info_url.format(song_id, song_id), timeout=4).json()
if res_json['code'] == 400:
raise requests.RequestException
if res_json['code'] == 400 or res_json['code'] == 406:
raise requests.RequestException("访问过于频繁或接口失效")
song_json = res_json['songs'][0]
artists_list = [info["name"] for info in song_json["artists"]]
# todo genre 曲目风格在json中并未找到
Expand Down
3 changes: 2 additions & 1 deletion MusicTager/components/work_thread.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
# -*- coding:utf-8 -*-
from PyQt5.QtCore import QThread, pyqtSignal
from functools import wraps, partial
from types import MethodType


def thread_drive(done_emit_func):
Expand All @@ -11,7 +12,7 @@ def outer(func):
def wrapper(self, *args, **kwargs):
self.work_thread = WorkThread(func, self, *args, **kwargs)
if done_emit_func:
res_func = partial(done_emit_func, self)
res_func = MethodType(done_emit_func, self)
self.work_thread.finished.connect(res_func)
self.work_thread.start()
return wrapper
Expand Down
1 change: 0 additions & 1 deletion MusicTager/ui/metadata_widget.py
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,6 @@ def _thread_auto_complete(self):
self.auto_dialog_show_signal.emit("")
try:
for row, file_path in zip(rows, path_list):
print(row)
if self.stop_auto:
self.auto_dialog.prepare_close_signal.emit("")
break
Expand Down

0 comments on commit c406493

Please sign in to comment.