40 lines
1.1 KiB
Python
40 lines
1.1 KiB
Python
#!/usr/bin/env python3
|
|
|
|
import sys
|
|
from collections import defaultdict
|
|
|
|
groups = defaultdict(list)
|
|
|
|
for line in sys.stdin:
|
|
line = line.rstrip("\n")
|
|
if not line:
|
|
continue
|
|
|
|
parts = line.split("\t")
|
|
if len(parts) != 9:
|
|
print(f"BAD LINE: {line!r}", file=sys.stderr)
|
|
continue
|
|
|
|
album_id, albumartist, album, year, albumtype, albumtotal, mb_albumid, mb_releasegroupid, path = parts
|
|
|
|
if not mb_releasegroupid:
|
|
continue
|
|
|
|
groups[mb_releasegroupid].append(parts)
|
|
|
|
for rgid, rows in sorted(groups.items()):
|
|
if len(rows) <= 1:
|
|
continue
|
|
|
|
print("=" * 100)
|
|
print(f"RELEASE GROUP DUPLICATE: {rgid}")
|
|
for row in rows:
|
|
album_id, albumartist, album, year, albumtype, albumtotal, mb_albumid, mb_releasegroupid, path = row
|
|
print(f"id={album_id}")
|
|
print(f" albumartist: {albumartist}")
|
|
print(f" album: {album}")
|
|
print(f" year/type: {year} / {albumtype}")
|
|
print(f" tracks: {albumtotal}")
|
|
print(f" mb_albumid: {mb_albumid}")
|
|
print(f" path: {path}")
|