[WINDOWS] Copy TV fanart
#1
Think this is the right Place.

heres some VB Script I Wrote to copy the fanart from a TV serial (if you use SB to get the TV programs)

I have setup XBMC background Images for TV show to look at a folder "F:\Backdrops\TV"

I wanted a way to copy all fanart form tv shows to that folder

so here its is .......
Code:
Const TvFolder = "E:\TV Shows"
Const BackdropFolder = "F:\Backdrops\TV"
Const FileName = "fanart.jpg"
call Main
'**********************************************************
'* Will Copy Fanart.jpg to a other folder but RENAME it to the Parent Folder name
'*
'* Don't change any thing below this line
'*
'**********************************************************
Sub Main()
Dim subfolder
Set fso = CreateObject("Scripting.FileSystemObject")
Set folder = fso.getFolder(TvFolder)
For Each subfolder In folder.subFolders
If ReportFileStatus(subfolder & "\" & FileName) Then
NewFileName = Replace(subfolder.Name, " ", "_")
Ext = Right(FileName, 4)
CopyFile = subfolder & "\" & FileName
Tofile = BackdropFolder & "\" & NewFileName & Ext
ret = fso.CopyFile(CopyFile, Tofile)
End If

Next

End Sub

Function ReportFileStatus(filespec)
   Dim fso, msg
   Set fso = CreateObject("Scripting.FileSystemObject")
   If (fso.FileExists(filespec)) Then
      ReportFileStatus = True
      Exit Function
   Else
      ReportFileStatus = False
      Exit Function
   End If
   Set fso = Nothing
End Function



copy and paste above copy in note pad
change the line 1 ,2 ,3 to match you system save as CopyFarart.vbs

and run it it will copy fanart.jpg to the BackdropFolder and give it the tv name (folder name)

don't forget to point XBMC Background Images to BackdropFolder

ps i'm old school hate spaces in filename. so it replace space with a _

only needs to be run once or when new TV show added to your system


Big Grin
Reply

Logout Mark Read Team Forum Stats Members Help
[WINDOWS] Copy TV fanart0