Skip to content

Commit

Permalink
zstd
Browse files Browse the repository at this point in the history
  • Loading branch information
sshane committed Jul 12, 2024
1 parent ffa6ebf commit e936d13
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 10 deletions.
17 changes: 9 additions & 8 deletions src/actions/files.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@ import * as Types from './types';
import { deviceOnCellular, getDeviceFromState, deviceVersionAtLeast, asyncSleep } from '../utils';

export const FILE_NAMES = {
qcameras: 'qcamera.ts',
cameras: 'fcamera.hevc',
dcameras: 'dcamera.hevc',
ecameras: 'ecamera.hevc',
qlogs: 'qlog.zst',
logs: 'rlog.zst',
qcameras: ['qcamera.ts'],
cameras: ['fcamera.hevc'],
dcameras: ['dcamera.hevc'],
ecameras: ['ecamera.hevc'],
qlogs: ['qlog.bz2', 'qlog.zst'],
logs: ['rlog.bz2', 'rlog.zst'],
};
const MAX_OPEN_REQUESTS = 15;
const MAX_RETRIES = 5;
Expand All @@ -21,7 +21,7 @@ let openRequests = 0;

function pathToFileName(dongleId, path) {
const [seg, fileType] = path.split('/');
const type = Object.entries(FILE_NAMES).find((e) => e[1] === fileType)[0];
const type = Object.entries(FILE_NAMES).find((e) => e[1] === fileType)[0][0];
return `${dongleId}|${seg}/${type}`;
}

Expand Down Expand Up @@ -118,6 +118,7 @@ export function fetchFiles(routeName, nocache = false) {
};
return state;
}, {});
console.log('urls', urls)

dispatch({
type: Types.ACTION_FILES_URLS,
Expand Down Expand Up @@ -170,7 +171,7 @@ export function fetchUploadQueue(dongleId) {
const segNum = urlParts[urlParts.length - 2];
const datetime = urlParts[urlParts.length - 3];
const dongle = urlParts[urlParts.length - 4];
const type = Object.entries(FILE_NAMES).find((e) => e[1] === filename)[0];
const type = Object.entries(FILE_NAMES).find((e) => e[1].includes(filename))[0];
const fileName = `${dongle}|${datetime}--${segNum}/${type}`;
const waitingWifi = Boolean(deviceOnCellular(device) && uploading.allow_cellular === false);
uploadingFiles[fileName] = {
Expand Down
2 changes: 1 addition & 1 deletion src/actions/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { getDeviceFromState, deviceVersionAtLeast } from '../utils';

let routesRequest = null;
let routesRequestPromise = null;
const LIMIT_INCREMENT = 5
const LIMIT_INCREMENT = 1000
const FIVE_YEARS = 1000 * 60 * 60 * 24 * 365 * 5;

export function checkRoutesData() {
Expand Down
2 changes: 1 addition & 1 deletion src/components/Files/UploadQueue.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ class UploadQueue extends Component {
</div>
</td>
<td className={ classes.uploadCell } style={ cellStyle }>
{ FILE_NAMES[type].split('.')[0].substring(0, logNameLength) }
{ FILE_NAMES[type][0].split('.')[0].substring(0, logNameLength) }
</td>
{ upload.current
? (
Expand Down

0 comments on commit e936d13

Please sign in to comment.