Browse Source

Convert lists to generators where possible

master
Felix 5 months ago
parent
commit
1b243ddfc8
  1. 8
      tangoinfo.py

8
tangoinfo.py

@ -128,7 +128,7 @@ class TangoInfoTagger:
if barcode in self.albumpage_cache:
if self.albumpage_cache[barcode].get(tint):
for field in ["genre", "date", "vocal"]:
for field in ("genre", "date", "vocal"):
# Do no overwrite with empty data
if not self.albumpage_cache[barcode][tint].get(field):
continue
@ -227,14 +227,14 @@ class TangoInfoTagger:
self.album_remove_request(album)
continue
for field in ["genre", "date", "vocal"]:
for field in ("genre", "date", "vocal"):
# Write track metadata
if self.albumpage_cache[barcode][tint].get(field):
tm[field] = self.albumpage_cache[barcode][tint][field]
for file in track.iterfiles():
fm = file.metadata
for field in ["genre", "date", "vocal"]:
for field in ("genre", "date", "vocal"):
if not self.albumpage_cache[barcode][tint].get(field):
continue
# Write file metadata
@ -284,7 +284,7 @@ class TangoInfoTagger:
table = table[0] # re.findall() returns a list
# Content inside of <tr> elements
trcontent = [match.groups()[0] for match in tr_regex.finditer(table)]
trcontent = (match.groups()[0] for match in tr_regex.finditer(table))
page_structure_warned = False # Ratelimit warnings

Loading…
Cancel
Save