Fix "file not found" on attachments with relative notation

This commit is contained in:
elpamplina 2025-05-14 17:59:50 +02:00
parent 5dbe58b2eb
commit 6203a76198
5 changed files with 11 additions and 4 deletions

View file

@ -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

View file

@ -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;

View file

@ -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",

View file

@ -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": {

View file

@ -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"
}