notion-to-md icon indicating copy to clipboard operation
notion-to-md copied to clipboard

Enhance media handler to handle Notion Database and Notion Page properties

Open souvikinator opened this issue 7 months ago • 4 comments

It works perfectly for me! My one question is can the downloadMedia also be made to handle the properties so that image URLs are also processed through an option?

Originally posted by @Anahkiasen in #26

souvikinator avatar Apr 22 '25 12:04 souvikinator

@Anahkiasen This is live on alpha.5 release. This happens by default now, you can further go ahead and configure it to be selective. For that I have added enabledFor property in the configuration. Also, check out comprehensive example in the latest blog post about media handlers.

souvikinator avatar Apr 25 '25 03:04 souvikinator

@souvikinator Been using this for some time now it's working great! My only question was whether transformImagePath should run on the page properties as well to be able to modify the image names? Some of them are too long with all the query parameters

Anahkiasen avatar Jun 09 '25 20:06 Anahkiasen

Hey @Anahkiasen, I think you meant transformPath in the Media handling strategies. The good part is that v4-alpha.5 onwards, all media handling strategies work for all the media, be it block, page_properties or database_properties, and you can configure them as well with an additional property called enableFor.

By default, it works for all three. You can find more details overe here: https://notionconvert.com/docs/v4/concepts/configuration/#download-strategy

souvikinator avatar Jun 16 '25 05:06 souvikinator

Maybe I'm just doing something wrong I'll double check, I have to download some of the same medias myself so I wanted the filenames to match to avoid redownloads, but I often end up with images having a _0_Image suffix when downloaded through the package, which I can't seem to remove. But now that I write it down I think I may have just thought a way that avoids me having to download some medias myself so I think this is more of an edge case/me problem. 😅 Otherwise everything works perfectly as described here 👍

Anahkiasen avatar Jun 16 '25 13:06 Anahkiasen