fix a lot of errors (pylance)

This commit is contained in:
2025-12-01 15:59:09 +01:00
parent ee0154fa89
commit 93dbcada7d
2 changed files with 193 additions and 394 deletions

View File

@@ -615,7 +615,7 @@ class ImageItemRecord(Record):
def ArtworkDB(model, imagelist, base_id=0x40, cache_data=({}, {})): def ArtworkDB(model, imagelist, base_id=0x40, cache_data=({}, {})):
while isinstance(ImageFormats.get(model, None), str): model = ImageFormats[model] while isinstance(ImageFormats.get(model, None), str): model = ImageFormats[model]
if not model in ImageFormats: return None if not model in ImageFormats: raise Exception
format_cache, image_cache = cache_data format_cache, image_cache = cache_data
formats = [] formats = []
@@ -813,7 +813,7 @@ class DatabaseReader:
return hh + self.f.read(size - 8) return hh + self.f.read(size - 8)
def __iter__(self): return self def __iter__(self): return self
def next(self): def __next__(self):
try: header = self._skip_header(Tags.IT) try: header = self._skip_header(Tags.IT)
except (IOError, InvalidFormat): raise StopIteration except (IOError, InvalidFormat): raise StopIteration
data_size = struct.unpack('<L', header[8:12])[0] - len(header) data_size = struct.unpack('<L', header[8:12])[0] - len(header)

583
repear.py

File diff suppressed because it is too large Load Diff