diff --git a/src/actions/files.js b/src/actions/files.js index dc7003e8..2f4d7ae4 100644 --- a/src/actions/files.js +++ b/src/actions/files.js @@ -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; @@ -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}`; } @@ -118,6 +118,7 @@ export function fetchFiles(routeName, nocache = false) { }; return state; }, {}); + console.log('urls', urls) dispatch({ type: Types.ACTION_FILES_URLS, @@ -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] = { diff --git a/src/actions/index.js b/src/actions/index.js index 9c6cc3e4..5913e505 100644 --- a/src/actions/index.js +++ b/src/actions/index.js @@ -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() { diff --git a/src/components/Files/UploadQueue.jsx b/src/components/Files/UploadQueue.jsx index eaa62d06..15043f43 100644 --- a/src/components/Files/UploadQueue.jsx +++ b/src/components/Files/UploadQueue.jsx @@ -238,7 +238,7 @@ class UploadQueue extends Component { - { FILE_NAMES[type].split('.')[0].substring(0, logNameLength) } + { FILE_NAMES[type][0].split('.')[0].substring(0, logNameLength) } { upload.current ? (