"""
GLAMWalk -- Volume 4: Libraries & Archives
06_audio_media_prefilter.py

A quick catalog-metadata-only check to skip audiobook/sheet-music entries before wasting a real network request on them.

Source: Volume Four, Section 1.6
Targets Python 3.11.4 -- see Volume One, Chapter 1.5/1.6.
"""

def is_probably_audio_or_media_only(row):
    haystack = " ".join([
        row.get("subjects", ""),
        row.get("bookshelves", ""),
        row.get("title", ""),
    ]).lower()

    return (
        ("audio" in haystack and "book" in haystack)
        or "librivox" in haystack
        or "sheet music" in haystack
    )
