Enumerable ADS names for scripting and user-definable fields in metapane

Here are 2 features I've been mulling over for months. I believe with these we could improve both scripting and UI immensely:

  • Enumerable ADS stream names for scripting.
    Writing into any ADS name of your choice with DOpus is as simple as using "filename:myCustomADS" as the 'filename'. However, that is a hard-coded value and requires you to know the name in advance. Apparently enumearing the existing streams is not so easy and it's impossible to query if a file has any ADS unless you're looking for a particular one. With this, we could develop scripts which can switch from one stream to another dynamically and store whatever information we want.
    I found some Microsoft code here (.NET Matters: Iterating NTFS Streams | Microsoft Docs) and was thinking about creating my own DOpus plugin, but this is probably something DOpus devs could do much more easily and not sure if this is what a plugin is supposed to do. If we could supply a filename and get its streams as an enumerable object, e.g. new Enumerator(DOpus.fsUtil.getStreams(fileName))... var streamName=e.item();, we could script it and read, update, delete these however we want. If this gets rejected, it's not a big deal as the next, related request.

  • User-definable fields in metapane the values of which are handled via user-script or in a user-definable ADS name.
    This is inspired by MP3Tag, which allows you to define arbitrary fields in its sidepane:

In the ADS variant, once for example fields 'cyComments, cyMyCustomField' and ADS 'cyMyPersonalADS' are defined, DOpus would either read from or write into 'filename:cyMyPersonalADS', ideally in JSON format which avoids many problems with commas, tabs, newlines in CSV or TSV. These would be scriptable already but not as powerful as the alternative below.

Personally I'd prefer script-fields in metapane. A script registers itself in its OnInit as the value supplier/handler for a fields list. Whenever DOpus sees these fields it calls back the script, e.g. OnMetadataFieldRead, OnMetadataFieldSave... Come to think of it, the script could register itself not only for custom ADS fields but any available metadata field like 'title,comments,cyMyCustomField', with a wildcard like *.mp3 or *.(gif|bmp|jpg). This would be the ultimate dream but a. Not sure if this would fit DOpus internal architecture and b. I vaguely remember script-fields were requested by others before and rejected, although I cannot find the thread and might be completely wrong.

Compared to one custom ADS, scripting decreases the usability for users who don't have the time or knowledge to use just a couple of custom fields but gives tremendous power. If we could register a script for already recognized fields, this could be arbitrarily extended for any format, existing or future ones. E.g. handling metapane changes in MKV files calls a user script which then calls mkvmerge.exe, all the while using DOpus as the UI to it. Or I could go on take a portion of MP3 & JPG handling off from DOpus' shoulders and save 'comments' field not in ID3 or EXIF but ADS instead. File formats which DOpus does not support natively or only partially could also be easily integrated into DOpus and that'd open a lot of possibilities for script sharing.

Regardless of the variant, the real savior here is the integration into DOpus and the metapane.

1 Like

And whenever you copy/move files to another filesystem - metadata go kaboom. No, thank you - anything is better than this.

Nobody forces you to use features you don't need.

Thanks for the suggestions!

We'll add a script method to query for ADS names in the next update (this is actually relatively easy to add).

Your idea for custom metadata fields is a lot more complicated, but we'll add it to the list for the future.

1 Like