From c5cf2c9cda3f7543e551e351c38fc731e9d92a3b Mon Sep 17 00:00:00 2001 From: Tomek Zebrowski Date: Sat, 13 Jun 2026 08:31:25 +0200 Subject: [PATCH] fix(drive): broaden regex to support .synced file extensions --- src/drive.js | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/drive.js b/src/drive.js index 7552a84..4e83528 100644 --- a/src/drive.js +++ b/src/drive.js @@ -154,13 +154,12 @@ class DriveManager { 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), @@ -518,7 +517,7 @@ class DriveManager { } 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])); @@ -527,7 +526,7 @@ class DriveManager { } 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; }