Script Column Displaying Incorrectly

I noticed something strange whilst getting familiar with ExifTool Custom Columns. There are some MP4 video clips in my Downloads folder so I thought I would test with a QuickTime-Duration column. The result appears as time of day rather than duration. I actually had two open Downloads tabs so I tried the same thing in the second tab and once again time of day is displayed rather than duration. Adding to the strangeness is the fact that the time of day displayed is different between the first and second Downloads tabs. I then created a 3rd instance of Downloads by duplicating one of the other two. This last instance correctly shows duration. The same is true for a new Downloads tab created from Favorites.

In an attempt to simplify for this report I isolated a single MP4 file and took screenshots of the three results including corresponding folder formats. First I deliberately reset the first tab to !folder which as can be seen made no difference. I also tried adding the column in different places; once again made no difference.

This is most likely a one-off and unless there is an obvious answer which escapes me (as is often the case) I don't expect the developers to spend time on this. Windows 10 Pro, DOpus 12.30.3 beta.

Script columns don't currently have a "duration" type - that column's type is set to "time" which is intended to show time of day. The bug is actually that you get a duration at times! I'm not sure why this would be happening.

The easiest solution would be to change the column type to show a normal string and format the duration string in the script.

I thought exactly the same thing when I first noticed this oddity so I modified the exifColumns definition in ColumnExifTool.js as shown below and that's what was used for the examples above.

var exifColumns = [
new DefineColumn('QuickTime', 'Duration', '', '', '', '', '', ''),
new DefineColumn('QuickTime', 'MediaDuration', '', '', '', '', '', '')
];

The script is giving Opus the value as a Date; that will auto-format as a date when asked to convert to string form. You'd need to change it to provide the value as a string (and format the string as hh:mm:ss or whatever yourself).

        if (value != '') {
            if (column.type == 'datetime' || column.type == 'date' || column.type == 'time') {
                value = DOpus.Create().Date(value.replace(/:/g, ''));
            } else if (column.type == 'number') {
                value = Number(value);
            } else if (column.type == 'duration') {
                // add code here for new "duration" type
            }
        }

Looks like a good opportunity to publish a new version. This duration issue is part of the changelog :slight_smile:

https://resource.dopus.com/t/exiftool-custom-columns/38975/38

3 Likes

Hello @lxp. My original problem with Duration went away after restarting DOpus. Whatever it was will likely remain one of life's enduring mysteries. :sunglasses:

Unfortunately, the latest version of your code introduces a new issue, best described with screen grabs.

Old Script

new DefineColumn('QuickTime', 'Duration', '', '', 'Duration', '', '', ''),

New Script

exifColumns.push_back(GetColumnMap('QuickTime', 'Duration', '', '', '', '', 'right', 'double'));

Changing 'double' to '' in the new script doesn't change the result.

The duration column in the upper screenshot is from Opus, right?

I couldn't reproduce the issue in the lower screenshot with any of my videos - any chance you could share one of those?

The Duration column in the first screen grab was generated by the 2021-07-17 version of ColumnExifTool using the definition immediately above the grab which explicitly specified the column header as Duration. I didn't bother changing the default header definition in the 2023-02-28 version.

At the risk of complicating matters further I tried doing the same thing on three systems - desktop, laptop and vm. All three are running W10 Pro (up to date) and DOpus v12.31. Results were different on all three as shown below. I will PM you a couple of the mp4 files that display -nan(ind) on at least one of the systems.

Desktop System

VM System (VMWare Player 16 running on my Desktop System)

Laptop System

Following a PM exchange with @lxp I tried deleting the cache and that resolved the problem.