diff --git a/src/main/services/SearchService.ts b/src/main/services/SearchService.ts index e4f91af..1d5cdf7 100644 --- a/src/main/services/SearchService.ts +++ b/src/main/services/SearchService.ts @@ -8,14 +8,13 @@ import { TagService } from './TagService'; */ interface CachedMetadata { author?: string; - copyright?: string; } /** * Represents a structured filter derived from the freeform query. */ interface AdvancedFilter { - field: 'author' | 'copyright'; + field: 'author'; value: string; } @@ -119,7 +118,7 @@ export class SearchService { } /** - * Pulls out author/copyright filters and returns the remaining free text query. + * Pulls out author filters and returns the remaining free text query. */ private extractAdvancedFilters(query: string): { filters: AdvancedFilter[]; remainingQuery: string } { const tokens = query.split(/\s+/); @@ -135,13 +134,6 @@ export class SearchService { } continue; } - if (lower.startsWith('copyright:')) { - const value = token.slice('copyright:'.length).trim(); - if (value.length > 0) { - filters.push({ field: 'copyright', value: value.toLowerCase() }); - } - continue; - } remainingTokens.push(token); } @@ -161,7 +153,7 @@ export class SearchService { const metadata = this.getCachedMetadata(file); return filters.every((filter) => { - const source = filter.field === 'author' ? metadata.author : metadata.copyright; + const source = metadata.author; if (!source) { return false; } @@ -180,8 +172,7 @@ export class SearchService { const metadata = this.tagService.readMetadata(file.absolutePath); const normalized: CachedMetadata = { - author: metadata.author?.trim() || undefined, - copyright: metadata.copyright?.trim() || undefined + author: metadata.author?.trim() || undefined }; this.metadataCache.set(file.id, normalized); return normalized; diff --git a/tsconfig.main.json b/tsconfig.main.json index 3df1694..9bd2942 100644 --- a/tsconfig.main.json +++ b/tsconfig.main.json @@ -2,7 +2,7 @@ "extends": "./tsconfig.base.json", "compilerOptions": { "module": "CommonJS", - "moduleResolution": "Bundler", + "moduleResolution": "Node", "outDir": "dist/main", "rootDir": "src", "types": ["node"],