Skip to content

TagSpaces is an offline, open source, document manager with tagging support

fix: path / url issues in the search index

Ilian Sapundshiev40fcdbb71212
diff --git a/app/reducers/app.ts b/app/reducers/app.ts
index af3eb4674..8a2fe47ea 100644
--- a/app/reducers/app.ts
+++ b/app/reducers/app.ts
@@ -1611,7 +1611,10 @@ export const actions = {
if (fsEntry.url) {
entryForOpening.url = fsEntry.url;
} else if (PlatformIO.haveObjectStoreSupport()) {
- entryForOpening.url = PlatformIO.getURLforPath(fsEntry.path);
+ const cleanedPath = fsEntry.path.startsWith('/')
+ ? fsEntry.path.substr(1)
+ : fsEntry.path;
+ entryForOpening.url = PlatformIO.getURLforPath(cleanedPath);
}
if (fsEntry.perspective) {
entryForOpening.perspective = fsEntry.perspective;
diff --git a/app/reducers/location-index.ts b/app/reducers/location-index.ts
index 99ce6af74..6d775c0bd 100644
--- a/app/reducers/location-index.ts
+++ b/app/reducers/location-index.ts
@@ -466,7 +466,10 @@ export const actions = {
(entry: FileSystemEntry) => {
// Excluding s3 folders from global search
if (entry && entry.isFile) {
- entry.url = PlatformIO.getURLforPath(entry.path);
+ const cleanedPath = entry.path.startsWith('/')
+ ? entry.path.substr(1)
+ : entry.path;
+ entry.url = PlatformIO.getURLforPath(cleanedPath);
if (
entry.thumbPath &&
entry.thumbPath.length > 1 &&