tiddly-gittly / TidGi-Desktop

TidGi is an privacy-in-mind, automated, auto-git-backup, freely-deployed knowledge management Desktop note app, based on Tiddlywiki, with REST API for web-clipping and Anki connect. 「 太记 」是一个基于「 太微 TiddlyWiki 」的知识管理桌面应用,能保护隐私内容、高级自动化、自动Git云备份、部署为博客,且可通过RESTAPI与Anki等应用连接。(迭代开发中欢迎试用,开发进度见下方链接)(Under active development, see website below for details)
https://tidgi.fun
Mozilla Public License 2.0
1.74k stars 111 forks source link

feature: Can the TidGi External Attachments Plugin support the use of relative yet absolute paths? #458

Closed heavenkiller2018 closed 1 year ago

heavenkiller2018 commented 1 year ago

Description 描述

Can the TidGi External Attachments Plugin support the use of relative yet absolute paths? The latter may hinder portability. For instance, I encountered an issue when attempting to modify the _canonical_uri field of an imported PDF file. I tried changing it from "file:///C:/Users/11507/Dropbox/TidGi-Desktop-Repo/Computer-Science/files/test.pdf" to "file:///../files/test.pdf," but was unsuccessful.

Additional Context 额外上下文

No response

linonetwo commented 1 year ago

file://../files

heavenkiller2018 commented 1 year ago

@linonetwo

Some Issues:

  1. The uploaded PDF file is not displaying correctly. Screenshot 2023-07-27 103400

  2. The uploaded MP4 file is not playing properly. Screenshot 2023-07-27 103305

  3. When I upload an .flac file(about 30MB), TidGi perceives it as a text tiddler, causing the system to slow down even crash down significantly.

Which file types are supported by this plugin for importing as "skinny tiddlers"?

I have a few suggestions to enhance this plugin's functionality in handling files:

  1. Portability: When dragging an external file into TidGi, it should be saved in a specified directory within the wiki, such as '../files', and named using a hash of its content(for Uniqueness). The original filename should be stored in a designated field called 'original_filename'. The '_canonical_uri' field should be set as a relative path rather than an absolute path, like "file://../files/test.pdf".

  2. When opening the generated tiddler, it should be rendered according to its filetype so that it can be directly interacted with. For example, a PDF file can be viewed, and an MP4 file can be played. Alongside the "Open In External App" functionality, these tiddlers with the '_canonical_uri' field should be opened by an external application based on their original filetype, rather than the extension of the tiddler itself, which merely serves as a pointer.

  3. An export function should be provided for these '_canonical_uri' tiddlers.

If the above proposals are implemented, I would be able to utilize TidGi to conviniently and effectively manage most of my PC files, such as PDFs, MP4s, and MP3s, instead of relying solely on the Windows File Explorer, as TidGi surpasses it in searching and information management capabilities. It is currently limited to handling solely text-based file formats.

linonetwo commented 1 year ago

https://talk.tiddlywiki.org/t/about-the-file-uploads-plugin/19

heavenkiller2018 commented 1 year ago

@linonetwo

For TidGi-Desktop,I have explored alternative solutions, excluding Fission and Github. The remaining options, namely PUT, Node.js, and Webdav, seemly, none of them proved successful. And the option for "Node.js files PUT uploader support" is not even displayed in the available configuration choices of "File Uploads". Is there a viable "File Uploads" solution available for TidGi-Desktop? Additionally, it seems that the feature of "File Uploads" may potentially clash with the functionality provided by the "External Attachments for TidGi" application because of their different approach to handling the _canonical_uri..

WebDAV

WebDAV-LS - 28th July 2023 at 8:22am
Error: Could not retrieve the contents of the directory /.

Failed to execute 'fetch' on 'Window': Failed to parse URL from /

PUT-uploader

PUT-uploader - 28th July 2023 at 8:39am (count: 2)
Error saving file test1.pdf: TypeError: Failed to execute 'fetch' on 'Window': Failed to parse URL from files/test1.pdf
linonetwo commented 1 year ago

feature of "File Uploads" may potentially clash with the functionality provided by the "External Attachments for TidGi"

Report there for him, maybe he knows

linonetwo commented 9 months ago

Here is the doc https://tidgi.fun/#TidGi%20Feature%20Handbook%2FReference%20External%20Files about this