From 305c69e06bd1e9d3a27d136b5dee412adb1c1d70 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=81=8D=E5=85=AE=E6=83=9A=E5=85=AE?= <101191390+HIllya51@users.noreply.github.com> Date: Sat, 3 Aug 2024 16:10:33 +0800 Subject: [PATCH] fix --- .../LunaTranslator/gui/dialog_savedgame.py | 1 + LunaTranslator/LunaTranslator/gui/specialwidget.py | 4 ++++ LunaTranslator/LunaTranslator/metadata/bangumi.py | 13 ++++++++----- 3 files changed, 13 insertions(+), 5 deletions(-) diff --git a/LunaTranslator/LunaTranslator/gui/dialog_savedgame.py b/LunaTranslator/LunaTranslator/gui/dialog_savedgame.py index b9985139..1c3b89cd 100644 --- a/LunaTranslator/LunaTranslator/gui/dialog_savedgame.py +++ b/LunaTranslator/LunaTranslator/gui/dialog_savedgame.py @@ -962,6 +962,7 @@ class dialog_setting_game_internal(QWidget): try: _qw.remove() savehook_new_data[gameuid][refkey].remove(t) + self.labelflow.removewidget(_qw) except: print_exc() diff --git a/LunaTranslator/LunaTranslator/gui/specialwidget.py b/LunaTranslator/LunaTranslator/gui/specialwidget.py index c823a5ea..b9e7e013 100644 --- a/LunaTranslator/LunaTranslator/gui/specialwidget.py +++ b/LunaTranslator/LunaTranslator/gui/specialwidget.py @@ -182,6 +182,10 @@ class ScrollFlow(QWidget): def insertwidget(self, idx, wid): self.l.insertWidget(idx, wid) + @trypass + def removewidget(self, wid): + self.l.removeWidget(wid) + @trypass def removeidx(self, index): _ = self.l.takeAt(index) diff --git a/LunaTranslator/LunaTranslator/metadata/bangumi.py b/LunaTranslator/LunaTranslator/metadata/bangumi.py index 3130a135..45a8f5c7 100644 --- a/LunaTranslator/LunaTranslator/metadata/bangumi.py +++ b/LunaTranslator/LunaTranslator/metadata/bangumi.py @@ -201,11 +201,14 @@ class searcher(common): developers = [] for _ in response["infobox"]: if _["key"] in ["游戏开发商", "开发", "发行"]: - for __ in _["value"]: - if isinstance(__, str): - developers.append(__) - elif isinstance(__, dict): - developers.append(__["v"]) + if isinstance(_["value"], str): + developers.append(_["value"]) + else: + for __ in _["value"]: + if isinstance(__, str): + developers.append(__) + elif isinstance(__, dict): + developers.append(__["v"]) return { # "namemap": namemap, "title": response["name"],