Sync attachments and linked files while excluding other media from sync

Use case or problem

My vault is set up in a way where it has a lot of media and large files, and related notes. I cannot sync all of it to my phone, so for now I set up sync to exclude images, videos and sounds. This creates a problem as embedded images, excalidraw diagrams are missing from my notes on mobile which sometimes makes them unreadable.

Proposed solution

Generate a some metadata in .obsidian about which files have been [[linked to]] or ![embedded] in .md files, and sync only those.

So basically to avoid syncing the entire vault folder.

Related feature requests (optional)