Skip to content
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion backend/akaigrid.ts
Original file line number Diff line number Diff line change
@@ -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";
Expand Down
10 changes: 7 additions & 3 deletions backend/entry.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion backend/file-stat.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Cache } from "jsr:@lambdalisue/ttl-cache";
import { Cache } from "jsr:@lambdalisue/ttl-cache@^1.0.0";

/**
* TTL: 60s
Expand Down
4 changes: 4 additions & 0 deletions backend/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -170,13 +170,17 @@ 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,
});
allowDevAllOrigin(res);
return res;
} catch (error) {
if (error instanceof Error) {
log.error(error.message);
}
return this.errorResponse(error);
}
});
Expand Down
4 changes: 0 additions & 4 deletions backend/util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion backend/util_test.ts
Original file line number Diff line number Diff line change
@@ -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";

Expand Down
2 changes: 1 addition & 1 deletion common/util_test.ts
Original file line number Diff line number Diff line change
@@ -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");
Expand Down
2 changes: 1 addition & 1 deletion deno.jsonc
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
// App Version
"version": "1.0.0",
"version": "1.0.2",

"unstable": [
// So format Vue components
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/components/HighlightString.vue
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ const array = computed(() => {

<template>
<span>
<span>
<span class="item-title">
<template v-for="(item, index) in array" :key="index">
<span v-if="item.match(/^\d+$/)" class="highlight">{{ item }}</span>
<span v-else-if="index === array.length - 1" class="ext">{{ item }}</span>
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/components/ItemDir.vue
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ function getRequestPath() {
<font-awesome-icon :icon='["fas", "folder"]' class="mt-3 ms-3 folder-icon" />
<img loading="lazy" :src='baseURL + "/api/thumbnail/" + encodeURIComponent(props.item.absolutePath)' alt />
</div>
<div class="mt-1">
<div class="mt-1 item-title">
{{ props.item.name }}
</div>
</router-link>
Expand Down
4 changes: 4 additions & 0 deletions frontend/src/styles/main.scss
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,10 @@ body {}
}
}

.item-title {
overflow-wrap: break-word;
}

&:hover {
background-color: lighten($akaigrid-dark, 10%);
}
Expand Down