I try to create new custom column to display coverart's height/width in VB.
But I don't understand why this failed...
' Implement the CoverArt column
Function OnPochette(scriptColData)
If scriptColData.item.metadata = "audio" and scriptColData.Item.Metadata.Audio.Coverart > 0 Then
scriptColData.value = scriptColData.Item.AudioMeta.CoverArt.width & "x" & scriptColData.Item.AudioMeta.CoverArt.height
End If
End Function
That error should have been reported in the script log. Remember to look in the script log if things don't work. It'll often give you useful information.
option explicit
Function OnInit(initData)
initData.name = "ColonnePochette"
initData.desc = "Ajoute une colonne avec la taille des pochettes."
initData.copyright = "2014 Albator V (Michiels Thomas)"
initData.min_version = "11.5.5"
initData.version = "v1.0"
Dim col
Set col = initData.AddColumn
col.name = "Pochette"
col.method = "OnPochette"
col.label = "Pochette"
col.header = "Pochette"
col.justify = "right"
col.autogroup = false
col.autorefresh = true
End Function
' Implement the CoverArt column
Function OnPochette(scriptColData)
If scriptColData.item.metadata = "audio" and scriptColData.Item.Metadata.Audio.Coverart > 0 Then
scriptColData.value = scriptColData.Item.AudioMeta.CoverArt.width & "x" & scriptColData.Item.AudioMeta.CoverArt.height
End If
End Function
Nothing is display to this column because log said...
ColonnePochette: Erreur à la ligne 28, position 3
ColonnePochette: Cet objet ne gère pas cette propriété ou cette méthode: 'scriptColData.item.AudioMeta' (0x800a01b6)
@AlbatorV, you're still a little too fast. You still have "scriptColData.item.AudioMeta" items to change to the correct one.
This line seems to be work:
scriptColData.value = scriptColData.Item.Metadata.Audio.Coverart(0).width & "x" & scriptColData.Item.Metadata.Audio.Coverart(0).height
.coverart is a collection.
When you want the properties of the coverarts you have to use .CoverArt(number).propertyname, or enumerate .CoverArt.
Each item is a AudioCoverArt object.