Save patch infomation for calls.

This commit is contained in:
Tad Smith
2024-12-13 20:46:06 +00:00
parent 29d72525bd
commit 350c83c259
4 changed files with 33 additions and 1 deletions

View File

@@ -20,6 +20,7 @@ const build_call_list = (items) => {
srcList: item.srcList,
star: item.star,
freq: item.freq,
patches: item.patches,
len: Math.round(item.len)
};
calls.push(call);
@@ -38,6 +39,7 @@ async function get_calls(query, numResults, middleDate, res) {
time: true,
srcList: true,
freq: true,
patches: true,
star: true,
len: true,
url: true

View File

@@ -108,6 +108,19 @@ exports.upload = async function (req, res, next) {
return;
}
patches = [];
let req_patches;
req_patches = req.body.patch_list;
if(typeof req_patches != "undefined"){
var split_patches = req_patches.replace("[","").replace("]","").split(",");
for (var patch in split_patches){
patches.push(split_patches[patch]);
}
}
let item = null;
await tracer.startActiveSpan('validate_system', { parent: trace.getActiveSpan(context.active()) }, async (validateSpan) => {
@@ -178,6 +191,7 @@ exports.upload = async function (req, res, next) {
url,
emergency,
path: local_path,
patches: patches,
srcList,
len: req.body.call_length ? parseFloat(req.body.call_length) : (stopTime - time) / 1000,
});

View File

@@ -17,6 +17,7 @@ const callSchema = mongoose.Schema({
emergency: Boolean,
path: String,
len: Number,
patches: [Number],
star: {
type: Number,
default: 0