
Function puttrackart(itm,boo)
Dim upd : upd = False
Dim first : first = True
Dim path : path = FileMask
path = Replace(path,"<path>",Mid(itm.Path,1,InStrRev(itm.Path,"\")-1))
If (itm.AlbumArtistName = "") Then
path = Replace(path,"<artist>",itm.ArtistName)
Else
path = Replace(path,"<artist>",itm.AlbumArtistName)
End If
If (itm.AlbumName = "") Then
path = Replace(path,"<album>",itm.Title)
Else
path = Replace(path,"<album>",itm.AlbumName)
End If
Dim name : name = Mid(itm.Path,InStrRev(itm.Path,"\"))
name = Mid(name,2,InStrRev(name,".")-2)
path = Replace(path,"<file>",name)
path = Replace(path,"<#>",Progress.Value+1)
path = Replace(path,"?","")
path = Replace(path,"!","")
path = Left(path,2)+ Replace(path,":","-",3)
path = Replace(path,"/","-")
path = Replace(path,"""","'")
Set out = SDB.Tools.FileSystem.CreateTextFile(gettrackart,True)
out.WriteData jpg.ImageData,jpg.ImageDataLenSet out = SDB.Tools.FileSystem.CreateTextFile(gettrackart,True)
If out Is Nothing Then MsgBox gettrackart
out.WriteData jpg.ImageData,jpg.ImageDataLen


Dim picscount
If InStr(FileMask,"<*>")>0 Then
picscount = pics.Count-1
Else
picscount=0
End If
For i = 0 To picscount If InStr(gettrackart,"<type>") > 0 Then
gettrackart = Replace(gettrackart,"<type>","")
If (i = 0) and (pics.Item(i).ItemType=0 or pics.Item(i).ItemType=3) Then
gettrackart = gettrackart&".jpg"
Else
gettrackart = gettrackart&"_"&(i+1)&"-"&SpellType(pics.Item(i).ItemType,True,False)&".jpg"
End If
Else
If (i = 0) Then
gettrackart = gettrackart&".jpg"
Else
gettrackart = gettrackart&"_"&(i+1)&".jpg"
End If
End If
Dim puttype : puttype = False
If InStr(path,"<type>") > 0 Then
path = Replace(path,"<type>","")
puttype = True
End If If puttype and InStrRev(puttrackart,"-")>0 Then
img.ItemType = SpellType(Mid(puttrackart,InStrRev(puttrackart,"-")+1,InStrRev(puttrackart,".")-InStrRev(puttrackart,"-")-1),False,first)
Else
img.ItemType=SpellType("",False,first)
End If
first = False
If puttype and InStrRev(puttrackart,"-")>0 Then
img2.ItemType = SpellType(Mid(puttrackart,InStrRev(puttrackart,"-")+1,InStrRev(puttrackart,".")-InStrRev(puttrackart,"-")-1),False,first)
Else
img2.ItemType=SpellType("",False,first)
End If
first = False
Function SpellType(imgtype,boo,boo1st)
If boo Then
Select Case imgtype
Case 3
SpellType="Front"
Case 4
SpellType="Back"
Case 5
SpellType="Inside"
Case 6
SpellType="CD"
Case Else
SpellType=imgtype
End Select
Else
Select Case LCase(imgtype)
Case "front"
SpellType=3
Case "back"
SpellType=4
Case "inside"
SpellType=5
Case "cd"
SpellType=6
Case Else
If InStr(LCase(imgtype),"cover")>0 Then
SpellType=3
Else
If InStr(LCase(imgtype),"page")>0 or InStr(LCase(imgtype),"pg")>0 Then
SpellType=5
Else
If InStr(LCase(imgtype),"label")>0 Then
SpellType=6
Else
If boo1st Then
SpellType=3
Else
SpellType=0
End If
End If
End If
End If
End Select
End If
End Function
Users browsing this forum: No registered users and 10 guests