Skip to content

Commit

Permalink
fix: If no title found from PDF content, then use {%t}_{%g} to parse …
Browse files Browse the repository at this point in the history
…filename
  • Loading branch information
l0o0 committed Feb 14, 2025
1 parent c254819 commit 037f2cf
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/modules/services/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ export class Scraper {
): Promise<SearchOption | null> {
let namepattern = getPref("namepattern");
// Get title from pdf page content.
// 1: title from PDF, 2: {%t}_{%g}
if (namepattern == "auto") {
let title = undefined;
try {
Expand All @@ -76,7 +77,7 @@ export class Scraper {
}
if (title) return { title };

return getArgsFromPattern(item.attachmentFilename, "{%t}");
return getArgsFromPattern(item.attachmentFilename, "{%t}_{%g}");
} else {
if (namepattern == "custom") namepattern = getPref("namepatternCustom");
return getArgsFromPattern(item.attachmentFilename, namepattern);
Expand Down

0 comments on commit 037f2cf

Please sign in to comment.