diff --git a/backend/akaigrid.ts b/backend/akaigrid.ts index c86531e..6c2e616 100644 --- a/backend/akaigrid.ts +++ b/backend/akaigrid.ts @@ -1,7 +1,7 @@ import * as fs from "@std/fs"; import * as path from "@std/path"; import { AkaiGridConfig, AkaiGridConfigSchema, isDemo, isDev, isFileLocked, isSamePath, isSubPath, log, start, videoExtensions } from "./util.ts"; -import * as yaml from "jsr:@std/yaml"; +import * as yaml from "jsr:@std/yaml@^1.0.10"; import { Entry } from "./entry.ts"; import { closeKv, initKv, kv, kvDeletePrefix } from "./db/kv.ts"; import { DirConfig, DirConfigSchema } from "../common/util.ts"; diff --git a/backend/entry.ts b/backend/entry.ts index f1ef681..bf9604a 100644 --- a/backend/entry.ts +++ b/backend/entry.ts @@ -200,10 +200,14 @@ export class Entry { size = stat.size; done = await this.getDone(); - if (stat.atime === null) { - dateAccessed = new Date(0).toJSON(); + const modifiedTime = (stat.mtime) ? stat.mtime : new Date(0); + const accessedTime = (stat.atime) ? stat.atime : new Date(0); + + // use stat.mtime if mtime is more recent + if (modifiedTime > accessedTime) { + dateAccessed = modifiedTime.toJSON(); } else { - dateAccessed = stat.atime?.toJSON(); + dateAccessed = accessedTime.toJSON(); } } catch (_) { // Probably not exist, but still return a valid object for Home diff --git a/backend/file-stat.ts b/backend/file-stat.ts index f4407f3..8d23062 100644 --- a/backend/file-stat.ts +++ b/backend/file-stat.ts @@ -1,4 +1,4 @@ -import { Cache } from "jsr:@lambdalisue/ttl-cache"; +import { Cache } from "jsr:@lambdalisue/ttl-cache@^1.0.0"; /** * TTL: 60s diff --git a/backend/server.ts b/backend/server.ts index 8f18864..ad325fb 100644 --- a/backend/server.ts +++ b/backend/server.ts @@ -170,6 +170,7 @@ export class Server { if (!path) { return this.errorResponse(new Error("No path specified")); } + log.info("Open:", path); await this.akaiGrid.open(path); const res = Response.json({ status: true, @@ -177,6 +178,9 @@ export class Server { allowDevAllOrigin(res); return res; } catch (error) { + if (error instanceof Error) { + log.error(error.message); + } return this.errorResponse(error); } }); diff --git a/backend/util.ts b/backend/util.ts index 72d2473..1fab6c6 100644 --- a/backend/util.ts +++ b/backend/util.ts @@ -9,10 +9,6 @@ import { VideoInfo } from "../common/util.ts"; import { fileURLToPath } from "node:url"; import * as jsonc from "@std/jsonc"; import * as semver from "@std/semver"; -import * as fs from "@std/fs"; - -// @types packages list here -import type {} from "npm:@types/winreg"; /** * After compiled, some files are inside the executable, so the path is different diff --git a/backend/util_test.ts b/backend/util_test.ts index 243b053..17ea717 100644 --- a/backend/util_test.ts +++ b/backend/util_test.ts @@ -1,4 +1,4 @@ -import { assertEquals, assertLess } from "jsr:@std/assert"; +import { assertEquals, assertLess } from "jsr:@std/assert@^1.0.16"; import { escapeString, generateThumbnail, getRFEHash, getVideoInfo } from "./util.ts"; import * as fs from "@std/fs"; diff --git a/common/util_test.ts b/common/util_test.ts index 0b33603..821a705 100644 --- a/common/util_test.ts +++ b/common/util_test.ts @@ -1,5 +1,5 @@ import { encodeRequestPath } from "./util.ts"; -import { assertEquals } from "jsr:@std/assert"; +import { assertEquals } from "jsr:@std/assert@^1.0.16"; Deno.test("test", async () => { let result = encodeRequestPath("C:\\Program Files (x86)\\SamsungPrinterLiveUpdate"); diff --git a/deno.jsonc b/deno.jsonc index 343b7be..bcc9838 100644 --- a/deno.jsonc +++ b/deno.jsonc @@ -1,6 +1,6 @@ { // App Version - "version": "1.0.0", + "version": "1.0.2", "unstable": [ // So format Vue components diff --git a/frontend/src/components/HighlightString.vue b/frontend/src/components/HighlightString.vue index 4702998..146e9a9 100644 --- a/frontend/src/components/HighlightString.vue +++ b/frontend/src/components/HighlightString.vue @@ -40,7 +40,7 @@ const array = computed(() => {