Currently, in tags.py, "media" is defined as an IppTag.NAME. The standard (and printers, most importantly!) defines it as an IppTag.KEYWORD. I've tested making the change from NAME to KEYWORD in my HP OfficeJet — without the change, the printer rejects the job, but with the change it works.
See https://www.pwg.org/ipp/ippguide.html for reference, heading "Common Job Attributes".
Thanks for fixing it.