async function setMeta (key, value) {
  // massage inputs
  var keyStr = datEncoding.toStr(key)

  // validate inputs
  if (!HYPERDRIVE_HASH_REGEX.test(keyStr)) {
    throw new InvalidArchiveKeyError()
  }
  if (!value || typeof value !== 'object') {
    return // dont bother
  }

  // extract the desired values
  var {title, description, type, memberOf, size, author, forkOf, mtime, writable} = value
  title = typeof title === 'string' ? title : ''
  description = typeof description === 'string' ? description : ''
  type = typeof type === 'string' ? type : ''
  memberOf = typeof memberOf === 'string' ? memberOf : ''
  var isOwnerFlag = flag(writable)
  if (typeof author === 'string') author = normalizeDriveUrl(author)
  if (typeof forkOf === 'string') forkOf = normalizeDriveUrl(forkOf)

  // write
  var release = await lock('archives-db:meta')
  var {lastAccessTime, lastLibraryAccessTime} = await getMeta(keyStr)
  try {
    await db.run(`
      INSERT OR REPLACE INTO
        archives_meta (key, title, description, type, memberOf, mtime, size, author, forkOf, isOwner, lastAccessTime, lastLibraryAccessTime)
        VALUES        (?,   ?,     ?,           ?,    ?,        ?,     ?,    ?,      ?,      ?,       ?,              ?)
    `, [keyStr, title, description, type, memberOf, mtime, size, author, forkOf, isOwnerFlag, lastAccessTime, lastLibraryAccessTime])
  } finally {
    release()
  }
  events.emit('update:archive-meta', keyStr, value)
}
@description Write an archive's metadata.
@param {string | Buffer} key
@param {LibraryArchiveMeta} [value]
@returns {Promise<void>}