I'm having a problem when I try to format a track with "%disc%" and the track doesn't have any disc tag.
In this case, I'm getting a OutOfMemoryException (if using with .NET) or an OutOfMemory Error (if using with vbs)
here's a vbs to show this (based on test-medialibrary.vbs from foosion's examples). See comments inside.
option explicit
dim fb2k, ml
dim t1, t2
SetupTest
'Get all tracks in media library
set t1 = ml.GetTracks()
'CHANGE
'Get a track with no disc tag. Change the index appropriately
set t2 = t1(93)
'OK, return the title
WScript.Echo t2.FormatTitle("%title%")
'OK, the track doesn't have a tag named %blabla%, so it returns '?'
WScript.Echo t2.FormatTitle("%blabla%")
'ERROR, the track doesn't have a %disc% tag, and an OutOfMemory error
'(OutOfMemoryException in .NET) is raised
WScript.Echo t2.FormatTitle("%disc%")
CleanupTest
WScript.Echo "Done"
WScript.Quit
rem *********************************************************
rem * helpers functions
rem *********************************************************
sub SetupTest()
dim ProgID
ProgID = "Foobar2000.Application.0.7"
rem WScript.Echo "Looking for existing instance..."
set fb2k = WScript.GetObject("", ProgID)
if isnull(fb2k) then
rem WScript.Echo "Creating new instance..."
set fb2k = WScript.CreateObject(ProgID)
if isnull(fb2k) then
WScript.Echo "Failed to get foobar2000 application object."
WScript.Quit
end if
end if
set ml = fb2k.MediaLibrary
if isnull(ml) then
WScript.Echo "Failed to get foobar2000 media library object."
WScript.Quit
end if
rem save settings
end sub
sub CleanupTest()
rem restore settings
end sub
Anyone else having this problem?