Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions src/drive.js
Original file line number Diff line number Diff line change
Expand Up @@ -154,13 +154,12 @@
const res = await gapi.client.drive.files.list({
pageSize: 100,
fields: 'nextPageToken, files(id, name, size, modifiedTime)',
q: `'${folderId}' in parents and name contains '.json' and trashed=false`,
q: `'${folderId}' in parents and (name contains '.json' or name contains '.gz' or name contains '.jsonl') and trashed=false`,
orderBy: 'modifiedTime desc',
pageToken: pageToken,
});

const files = res.result.files || [];

const processedFiles = files.map((f) => ({
file: f,
meta: this.getFileMetadata(f.name),
Expand Down Expand Up @@ -259,7 +258,7 @@
}

initSearch() {
const inputs = {

Check warning on line 261 in src/drive.js

View workflow job for this annotation

GitHub Actions / validate_and_build

'inputs' is assigned a value but never used

Check warning on line 261 in src/drive.js

View workflow job for this annotation

GitHub Actions / validate_and_build

'inputs' is assigned a value but never used
text: document.getElementById('driveSearchInput'),
clearText: document.getElementById('clearDriveSearchText'),
start: document.getElementById('driveDateStart'),
Expand Down Expand Up @@ -518,7 +517,7 @@
}

getFileMetadata(fileName) {
const match = fileName.match(/-(\d+)-(\d+)(?:\.jsonl|\.json|\.gz)+$/);
const match = fileName.match(/-(\d+)-(\d+)(?:\.[a-zA-Z0-9]+)+$/);
if (!match) return { date: 'Unknown', length: '?' };

const date = new Date(parseInt(match[1]));
Expand All @@ -527,7 +526,7 @@
}

extractTimestamp(fileName) {
const match = fileName.match(/-(\d+)-(\d+)(?:\.jsonl|\.json|\.gz)+$/);
const match = fileName.match(/-(\d+)-(\d+)(?:\.[a-zA-Z0-9]+)+$/);
return match ? parseInt(match[1]) : 0;
}

Expand Down
Loading