From 6203a761982e9934f3b8a83bc205e6aae3e5e888 Mon Sep 17 00:00:00 2001 From: elpamplina Date: Wed, 14 May 2025 17:59:50 +0200 Subject: [PATCH] Fix "file not found" on attachments with relative notation --- CHANGELOG.md | 6 ++++++ main.ts | 2 +- manifest.json | 2 +- package.json | 2 +- versions.json | 3 ++- 5 files changed, 11 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8172c42..05613b0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,11 @@ # Changelog +## [1.1.1](https://github.com/elpamplina/mastodon-threading/compare/1.1.0...1.1.1) + +### Bug fixes + +* Fixed "file not found" when attachment folder were configured by relative notation. + ## [1.1.0](https://github.com/elpamplina/mastodon-threading/compare/1.0.9...1.1.0) ### New features diff --git a/main.ts b/main.ts index 3172364..c3ef7dd 100644 --- a/main.ts +++ b/main.ts @@ -285,7 +285,7 @@ export default class MastodonThreading extends Plugin { if (file === null) { // Try on the attachment folder // @ts-ignore - file = this.app.vault.getFileByPath(`${this.app.vault.getConfig("attachmentFolderPath")}/${m[1]}`); + file = this.app.vault.getFileByPath(`${this.app.vault.getConfig("attachmentFolderPath").replace(/^\.\//, '')}/${m[1]}`); if (file === null) { new Notice(t('error.file_not_found')); return; diff --git a/manifest.json b/manifest.json index ae31d64..84d124b 100644 --- a/manifest.json +++ b/manifest.json @@ -1,7 +1,7 @@ { "id": "mastodon-threading", "name": "Mastodon Threading", - "version": "1.1.0", + "version": "1.1.1", "minAppVersion": "1.7.7", "description": "Compose and post threads to Mastodon.", "author": "El Pamplina de Cai", diff --git a/package.json b/package.json index 7693194..f83a467 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "mastodon-threading", - "version": "1.1.0", + "version": "1.1.1", "description": "Obsidian plugin to compose and post threads to Mastodon", "main": "main.js", "scripts": { diff --git a/versions.json b/versions.json index e380514..8e91508 100644 --- a/versions.json +++ b/versions.json @@ -6,5 +6,6 @@ "1.0.7": "1.7.7", "1.0.8": "1.7.7", "1.0.9": "1.7.7", - "1.1.0": "1.7.7" + "1.1.0": "1.7.7", + "1.1.1": "1.7.7" } \ No newline at end of file