Skip to content

Commit 142c6c5

Browse files
committed
WIP
- Tweak some logging around "maybe cptv files"
1 parent c3a7582 commit 142c6c5

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

api/api/V1/Recording.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ import type { Application, NextFunction, Request, Response } from "express";
5959
import { body, param, query } from "express-validator";
6060
import type { JwtPayload } from "jsonwebtoken";
6161
import jwt from "jsonwebtoken";
62-
import Sequelize, { Op } from "sequelize";
62+
import { Op } from "sequelize";
6363
import LabelPaths from "../../classifications/label_paths.json" with { type: "json" };
6464

6565
import {
@@ -125,7 +125,6 @@ import { TrackTagUserData } from "@models/TrackTagUserData.js";
125125
import { Device } from "@models/Device.js";
126126
import { Station } from "@models/Station.js";
127127
import { Visit } from "@models/Visit.js";
128-
import logger from "@log";
129128

130129
const sequelize = await initSequelize();
131130

@@ -1846,7 +1845,7 @@ export default (app: Application, baseUrl: string) => {
18461845
// FIXME - should probably not be success
18471846
return successResponse(response, "Tag already exists.");
18481847
}
1849-
} catch (e) {
1848+
} catch (_e) {
18501849
return next(new FatalError("Server error replacing tag."));
18511850
}
18521851
},
@@ -2773,7 +2772,7 @@ export default (app: Application, baseUrl: string) => {
27732772
),
27742773
);
27752774
}
2776-
} catch (e) {
2775+
} catch (_e) {
27772776
return successResponse(response, "Got recordings", {
27782777
recordings: [],
27792778
});

api/api/fileUploaders/uploadGenericRecording.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -343,8 +343,11 @@ const processFilePart = async (
343343
// TODO: The file could be corrupt, but we could still get a valid CPTV header out.
344344
// test this case.
345345
const header = await decoder.getHeader();
346-
if (header) {
347-
console.log("Header found in corrupt CPTV file", header);
346+
if (header && typeof header !== "string") {
347+
log.info(
348+
"Header found in corrupt CPTV file: %s",
349+
JSON.stringify(header),
350+
);
348351
embeddedMetadata = header;
349352
}
350353
}

0 commit comments

Comments
 (0)