Vendored 5 packages from iOpenPod (TheRealSavi/iOpenPod): iTunesDB_Writer/ — binary iTunesDB generation iTunesDB_Shared/ — field defs, constants, album identity SQLiteDB_Writer/ — SQLite databases for Nano 6G/7G iTunesDB_Parser/ — play stats reading from iPod ipod_device/ — device detection, FireWire ID, capabilities Rationale: iOpenPod is a standalone iPod manager app, not a library. Pulling it as a pip dependency is heavy and confusing for users. Changes: + src/vendor/ — 77 .py files + calcHashAB.wasm (506 KB) ~ ipod_nano7_db.py — _find_iop_root() now returns src/vendor/ ~ requirements.txt — iopenpod replaced with wasmtime + pycryptodome ~ .gitignore — removed iOpenPod/ exclusion (setup.py reads requirements.txt automatically)
31 lines
945 B
Python
31 lines
945 B
Python
"""MHII (Artist Item) parser for iTunesDB.
|
|
|
|
Each MHII lives inside an MHLI (artist list, MHSD type 8) and contains
|
|
artist-level metadata (artist_id, SQL ID) plus MHOD type-300 children
|
|
with the artist name string.
|
|
|
|
NOTE: This chunk shares the ``mhii`` magic with ArtworkDB image items,
|
|
but in the iTunesDB context it represents an artist record.
|
|
"""
|
|
|
|
from __future__ import annotations # noqa: I001
|
|
|
|
import iTunesDB_Shared as idb
|
|
|
|
from ._parsing import ParseResult
|
|
from .chunk_parser import parse_children
|
|
|
|
|
|
def parse_artist_item(
|
|
data: bytes | bytearray,
|
|
offset: int,
|
|
header_length: int,
|
|
chunk_length: int,
|
|
) -> ParseResult:
|
|
"""Parse an MHII (Artist Item) chunk and its MHOD children."""
|
|
mhii = idb.read_fields(data, offset, "mhii", header_length)
|
|
mhii["children"], _ = parse_children(
|
|
data, offset + header_length, mhii["child_count"],
|
|
)
|
|
return {"next_offset": offset + chunk_length, "data": mhii}
|