#bookbrainz

/

      • LupinIII joined the channel
      • 2024-10-15 28919, 2024

      • ApeKattQuest has quit
      • 2024-10-15 28924, 2024

      • HSOWA has quit
      • 2024-10-15 28931, 2024

      • HSOWA joined the channel
      • 2024-10-15 28923, 2024

      • rodrigo-morales joined the channel
      • 2024-10-15 28935, 2024

      • leftmostcatUTC-7 joined the channel
      • 2024-10-15 28936, 2024

      • 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?
      • 2024-10-15 28929, 2024

      • monkey[m]
        The ORM would be the right place, which allows us to use it for other projects like the WIP importer for example
      • 2024-10-15 28909, 2024

      • monkey[m]
        In src/validators/edition.ts most likely
      • 2024-10-15 28921, 2024

      • monkey[m]
        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
      • 2024-10-15 28940, 2024

      • monkey[m]
        Specifically to the Edition validator
      • 2024-10-15 28913, 2024

      • 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.
      • 2024-10-15 28939, 2024

      • 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/download/chatbrainz.org/PqgfsWXfxlnPygsdwaMlmIiH>)
      • 2024-10-15 28930, 2024

      • 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?
      • 2024-10-15 28952, 2024

      • leftmostcatUTC-7
        Something like isbn13, barcode, loc_lccn, etc.?