load_metadata = function(filename) local mfile = metadata_file(filename) local mpath = full_path(mfile) if not nativefs.getInfo(mpath) then -- comments will always have metadata, -- so we only get here for top-level posts with no parent return {replies={}} end local contents, err = App.read_file(mpath) if not contents then error(err) end return json.decode(contents) end