[2026-09-27] eagle: personal/plans/music-artist-albumartist-repair.md personal/plans/tagwriter-container.md personal/tech/id3-tag-repair.md personal/tech/music-tags-repair-truenas.md personal/tech/scripts/find_aa_hijack.py personal/tech/scripts/find_va_misuse.py

This commit is contained in:
Alexey Martemyanov committed 2026-09-27 14:19:15 +06:00
1 parent 463a77ac5d
commit 2520fda13b
6 files changed
+359 -47

No files matched your search

+11 -20
View File
@@ -1,31 +1,22 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""Детектор: aa='Various Artists' у папки, где БОЛЬШИНСТВО файлов имеет одного artist.
"""Detector A2 — 'Various Artists' on a folder that has only ONE artist.
Класс дефекта (сессия 8, 2026-09-27):
Папка-АЛЬБОМ помечена 'Various Artists', хотя исполнитель один.
Причины ложного срабатывания критерия «разные artist = сборник»:
1. разнобой написания одного исполнителя
('Иванушки' / 'Иванушки Int.' / 'Иванушки International');
2. несколько чужих файлов в корне папки артиста
(7 чужих треков среди 52 треков 'Агата Кристи').
Rule (Alex): Various Artists ONLY when the performers are genuinely different.
One artist — including spelling variants (Иванушки / Иванушки Int. / Иванушки
International) and featured credits — gets THAT artist. For a DJ-mix compilation the
albumartist is the DJ who compiled it, not Various Artists.
Правило Alex: «Папка с 1 уникальным артистом → АЛЬБОМ, albumartist = artist».
Iterate until it reports zero candidates: the classes are nested — fixing one reveals
the next (e.g. Агата Кристи → 9999 - Разное/Проекты).
Запуск:
Usage:
python3 find_va_misuse.py [путь_к_APPLY-PLAN.csv]
Выход: список папок-кандидатов с частотой доминирующего артиста.
⚠️ Кандидат ≠ дефект. Каждый случай подтверждать у Alex (правило сессии 7:
«не отвечать за Alex»). Спорный случай: '!Рэп/НТЛ' — формально попадает
под правило сборника из сессии 5 (треки в корне при наличии подпапок-альбомов).
Контроль после правок: гонять детектор, пока он не вернёт пусто или только
подтверждённые Alex спорные случаи (класс выявляется итеративно).
"""
import sys
import csv
import collections
import sys
P = sys.argv[1] if len(sys.argv) > 1 else '/Users/admin/Downloads/music-tags/APPLY-PLAN.csv'
rows = list(csv.DictReader(open(P, encoding='utf-8-sig', newline='')))
@@ -49,7 +40,7 @@ for folder, rs in sorted(by.items()):
continue
top, n = art.most_common(1)[0]
total = len(rs)
# доминирует один артист: >50% файлов
# one artist dominates — folder is NOT a genuine compilation
if n / total > 0.5 and n >= 2:
suspects.append((n, total, top, folder))