yuchen-lea / org-media-note

Taking interactive notes when watching videos or listening to audios in org-mode.
GNU General Public License v3.0
243 stars 35 forks source link

Home folder video: links #7

Closed nanjigen closed 3 years ago

nanjigen commented 3 years ago

Normal file links in org use the tilde dash prefix ~/, but for org-media-note video: links; the full path is included instead, breaking links across systems with different usernames: video:/home/nanjigen/Videos/movie.mp4 vs the preferred video:~/Videos/movie.mp4.

Also, at least for me, using insert i to insert a timestamp creates a link with the prefix nil instead of video; which means I need to repair the link by hand - other than these two issues once edited the links work great

yuchen-lea commented 3 years ago

I mainly use videoref link, so I don't need to deal with the video path. For your situation and a general way, I'm not sure which is better:

  1. substitue /home/nanjigen to ~
  2. change the absolute file path to relative path, which is interpreted relative to the directory of org file

nil prefix is really really an awful experience. I guess that's because org-media-note--video-types and org-media-note--audio-types didn't contain your media file type. What's your media file type (extension) ?

nanjigen commented 3 years ago

Thanks yuchen. I believe there is a built-in for this, have a look at org-link-file-path-type. I currently have mine set to adaptive (I believe this is default on Doom) and it produces the 'absolute' path option with ~.

As for my video type, the video is .mpg. This is related to #6, adding mpg to org-media-note--video-types fixes the nil: link prefix, but not the attach-dir issues with that filetype mentioned in #6

yuchen-lea commented 3 years ago

Thanks for telling me about org-link-file-path-type. Although it can't be used directly, it's not difficult to keep consistent with it. Now, the media link and screenshot link should be the format set by org-link-file-path-type. Check the doc for more info.

It works well on my computer, hope it also works for you :D

nanjigen commented 3 years ago

This works great for me too, thanks @yuchen-lea !