mikf / gallery-dl

Command-line program to download image galleries and collections from several image hosting sites
GNU General Public License v2.0
11.64k stars 950 forks source link

Add an option to store metadata in xattrs #1772

Open selurvedu opened 3 years ago

selurvedu commented 3 years ago

That's one of the uses they were designed for. Of course, that will work only on supported OSes and file systems.

rautamiekka commented 3 years ago

That's the problem right there: if the host OS is Linux with, say, ext4, and a Window$ (with any fs) downloads the files, the data is gone.

selurvedu commented 3 years ago

It's an opt-in advanced feature for advanced users, I guess. A person who does not use an OS and an FS with xattrs support would not know what xattrs are and how to use them, so they would lose nothing if they copy the data to e.g. NTFS. Moreover, that person would not have the option enabled in the first place.

I can imagine a situation when a user copies the files to a non-supported FS to, say, move all their data to another computer or to repartition the disk, with an intent to put them back to a supported FS, without realising the xattrs would get lost. However, this is a known xattrs limitation, and anyone who wants to use them should be also aware about this. A note in the description of the option should cover this.

I want this to be an alternative for separate metadata files, not a replacement for them.

thatfuckingbird commented 3 years ago

Even when moving files between filesystems that both support xattrs care needs to be taken to copy the xattrs (for example, cp doesn't even copy them by default iirc). Same goes when making backups, etc. I think they are a pretty horrible idea overall. I guess it would be fine as an option, it's just surprising to me anyone would want this.

By the way, NTFS has a comparable feature called alternate data streams so a similar thing can be done there too but it requires a different implementation.

rautamiekka commented 3 years ago

Ya, no app I know copies xattr by default, just checked that rsync also doesn't.

Ya, NTFS/ReFS ADS would be another spoke in the wheels, not to mention exFAT or FAT16 or 32. Hell, special support to transfer the data locally would be needed in addition to needing a read/write driver for the fs.

^ Or use an rsync Server and Client, maybe.