#bookbrainz

/

      • LupinIII joined the channel
      • ApeKattQuest has quit
      • HSOWA has quit
      • HSOWA joined the channel
      • rodrigo-morales joined the channel
      • leftmostcatUTC-7 joined the channel
      • leftmostcatUTC-7
        It's bothering me that ISBN validation is regex-only (and similar for barcodes) and I've been thinking about how to address this. I'm not sure where the functionality would belong; -data-js at a glance still seems to be a fairly thin ORM wrapper, so this doesn't seem appropriate. Should I add validation functions to -site, even though it would require special-casing on specific identifiers?
      • monkey[m]
        The ORM would be the right place, which allows us to use it for other projects like the WIP importer for example
      • In src/validators/edition.ts most likely
      • The issue is that currently the regexp used for validation is stored in the database along with each identifier type, so it will require some modifications
      • Specifically to the Edition validator
      • leftmostcatUTC-7
        Ahh, I missed/forgot about the validators folder. Yeah, I don't want to do too much to subvert the existing database-based validation, but maybe adding an extra block after validating identifiers which can do ISBN/barcode verifications. Still requires assuming that one of the fields in the identifier type table is stable, but I don't know that there's any getting around that.
      • monkey[m]
        I see no issue with something like this being added to the validateEdition function after calling validateIdentifiers:... (full message at <https://matrix.chatbrainz.org/_matrix/media/v3/...>)
      • leftmostcatUTC-7
        What to select on is the question, though. :) Label seems like the column least likely to change, but since it's intended to be human-readable, it feels a little icky. Does it make sense to maybe add a name column to the table which is intended to be stable and not used for display?
      • Something like isbn13, barcode, loc_lccn, etc.?