I've been going through another round of 'fixing' mp3 tags - and was wondering if there's an "easy" way we can tap additional tag values via scripting, somehow leveraging whatever's Opus already using (I thought taglib at one point, but we've also got Leo's audiotags plugin).
Cutting to the chase... I'm looking to expose the TSOA (albumsort) field for use in Opus (again, columns, tagging, infotips, etc).
Is there a column for it in Explorer (maybe via a shell extension, if not built-in)? If so it should be possible to use the same in Opus with a few lines of script. If not it might only be possible via code changes, since I don't think we pass that tag through ourselves at the moment.
Well, this adds the column, but none of the tag data is populated - any ideas?
Function OnInit(initData)
DOpus.Output("Initializing...")
' Provide basic information about the Script
initData.name = "AlbumSort_ColumnHandler"
initData.desc = "Adds the 'Album Sort' column from Windows 10 to Opus for MP3 files"
initData.copyright = "(c) 2017 steje"
initData.version = "1.0"
initData.default_enable = true
initData.min_version = "12.5.0"
Dim props, prop, col
Set props = DOpus.FSUtil.GetShellPropertyList("Sort album", "d")
for each prop in props
Set col = initData.AddColumn
col.name = prop.raw_name
col.method = "OnAlbumSortColumn"
col.label = prop.display_name
col.justify = "left"
col.autogroup = true
col.userdata = prop.pkey
next
End Function
Function OnAlbumSortColumn(scriptColData)
scriptColData.value = scriptColData.item.shellprop(scriptColData.userdata)
End Function
Is "sort album" the right (internal) name for the column? If it's just the label from the column heading, it won't always be the same name that the code needs.
Sometimes you have to search a bit to find the right name. I think the manual shows how to get a list of all column names matching a wildcard, unless I picked that up from somewhere else. (On a phone at present.)
Hi... Yeah, it's the right name. I got it and other data from another use of GetShellPropertyList(), and when I output the other properties of the item, I get expected raw_name and display_name values. Just no actual tag data in the column.
Maybe one of those 'Explorer' only interop issues?
Over the years I have found, both in computing and in the shop, that a specialized tool almost always beats a general use tool. I use DOpus for managing music files and transferring to devices, ie file management. But I haven't seen anything as good as Mp3tag when it comes to tagging. Very powerful.
Is data shown in Explorer for that column and the same file?
It's also possible there is another column in Explorer with a similar name. Or that the type of data the column is returning isn't what you were expecting (e.g. it might be a collection of strings, not just one string, with some columns).