'Return the path, size and mtime for the specified format for the specified book.
You should not use path unless you absolutely have to,
since accessing it directly breaks the threadsafe guarantees of this API. Instead use
the :meth:`copy_format_to` method.
:param allow_cache: If ``True`` cached values are used, otherwise a
slow filesystem access is done. The cache values could be out of date
if access was performed to the filesystem outside of this API.
:param update_db: If ``True`` The max_size field of the database is updated for this book.'

@api
def format_metadata(self, book_id, fmt, allow_cache=True, update_db=False):

    if (not fmt):
        return {}
    fmt = fmt.upper()
    if allow_cache:
        x = self.format_metadata_cache[book_id].get(fmt, None)
        if (x is not None):
            return x
    with self.safe_read_lock:
        try:
            name = self.fields[u'formats'].format_fname(book_id, fmt)
            path = self._field_for(u'path', book_id).replace(u'/', os.sep)
        except:
            return {}
        ans = {}
        if (path and name):
            ans = self.backend.format_metadata(book_id, fmt, name, path)
            self.format_metadata_cache[book_id][fmt] = ans
    if (update_db and (u'size' in ans)):
        with self.write_lock:
            max_size = self.fields[u'formats'].table.update_fmt(book_id, fmt, name, ans[u'size'], self.backend)
            self.fields[u'size'].table.update_sizes({book_id: max_size})
    return ans
