From 3f7dd6fd096a4d0f04b2b50183c321d95b4db78a Mon Sep 17 00:00:00 2001 From: Jonathan Poltak Samosir Date: Tue, 27 Feb 2024 09:47:27 +0700 Subject: [PATCH] Use FS path for {{{PageUrl}}} on local PDFs - For uploaded local PDFs it would prev resolve the upload locator and thus the memex.cloud/ct/ URL --- external/@worldbrain/memex-common | 2 +- src/copy-paster/background/template-data-fetchers.ts | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/external/@worldbrain/memex-common b/external/@worldbrain/memex-common index 32403bc9fe..c06f091725 160000 --- a/external/@worldbrain/memex-common +++ b/external/@worldbrain/memex-common @@ -1 +1 @@ -Subproject commit 32403bc9fee1dace7b39c01ad1ee2a288fbe6d64 +Subproject commit c06f091725ce1989c64d1c38444a819b3e919371 diff --git a/src/copy-paster/background/template-data-fetchers.ts b/src/copy-paster/background/template-data-fetchers.ts index 3899e05ab0..56eb2a6aba 100644 --- a/src/copy-paster/background/template-data-fetchers.ts +++ b/src/copy-paster/background/template-data-fetchers.ts @@ -28,6 +28,7 @@ import type { ImageSupportInterface } from 'src/image-support/background/types' import type { CustomList } from '@worldbrain/memex-common/lib/types/core-data-types/client' import type { FollowedListEntry } from 'src/page-activity-indicator/background/types' import type { AutoPk } from '@worldbrain/memex-common/lib/storage/types' +import { ContentLocatorType } from '@worldbrain/memex-common/lib/personal-cloud/storage/types' export function getTemplateDataFetchers({ storageManager, @@ -117,7 +118,10 @@ export function getTemplateDataFetchers({ const pageLocators = allLocators.filter( (l) => l.normalizedUrl === page.url, ) - const mainLocator = pickBestLocator(pageLocators) + const mainLocator = pickBestLocator(pageLocators, { + ignoreUploadLocators: true, + priority: ContentLocatorType.Remote, + }) fullUrl = mainLocator?.originalLocation ? encodeURI(mainLocator.originalLocation) : page.fullUrl