fix: (regression 0.49.0) file descript.ion listed as result in search

Massimo Melina committed Sep 25, 2023 at 13:28 UTC 99b4b722d9b503f267f47972c754abffd4ab1640
1 file changed +2 -1
src/api.file_list.ts
+2 -1
@@ -20,6 +20,7 @@ import _ from 'lodash'
20 import { HTTP_FOOL, HTTP_METHOD_NOT_ALLOWED, HTTP_NOT_FOUND } from './const'
21 import Koa from 'koa'
22 import { descriptIon, DESCRIPT_ION, getCommentFor } from './comments'
23 +import { basename } from 'path'
24
25 export interface DirEntry { n:string, s?:number, m?:Date, c?:Date, p?: string, comment?: string }
26
@@ -68,7 +69,7 @@ export const get_file_list: ApiHandler = async ({ uri, offset, limit, search, c
69 async function* produceEntries() {
70 for await (const sub of walker) {
71 if (ctx.aborted) break
71 - const name = getNodeName(sub)
72 + const name = basename(getNodeName(sub))
73 if (descriptIon.get() && name === DESCRIPT_ION)
74 continue
75 if (!filter(name))