Normal
Hi there,I created a little Batch-Script that I'd like to share. It scans your Music-Folder and creates Folder thumbs for your Artists-Folders using your Mediaportal Thumbs-Folder. Additionally, you can choose if all thumbnails should be set as hidden.So your Music Folder that may look like this[ATTACH]188753[/ATTACH]might look like this[ATTACH]188752[/ATTACH]If the folder already contains a "folder.jpg"-File, it will be left unchanged. A log is created to keep track what the script did.Instructions:Save the .bat in your Music-Folder, run it and follow the instructions.If you are using a custom Thumbs-Folder (other than "C:\ProgramData\Team MediaPortal\MediaPortal\Thumbs\Music\Artists") set it in the beginning of the .bat-File after "THUMBSFOLDER=" like this:[CODE]set THUMBSFOLDER=Q:\Some random\custom\path[/CODE].You can also specify the Music-Folder in the .bat-File, so you can save the File somewhere else, in a similar fashion:[CODE]set MUSICFOLDER=M:\My Music Folder[/CODE]For those two options please make sure that the path does not end with a backslash and is not encased in quotation-marks.[SPOILER="Source-Code"][CODE=WinBatch]@echo off:: Add the Path to your MediaPortal-Thumbsfolder (no backslash at the end)set THUMBSFOLDER=:: Add the Path to your Music-Folder (no backslash at the end)set MUSICFOLDER=:: =======================================================================================echo Music-Folder-Artist-Thumb-Creator (v1.0)echo -- by bta489 ---------------------------echo.if NOT DEFINED THUMBFOLDER ( set THUMBSFOLDER=C:\ProgramData\Team MediaPortal\MediaPortal\Thumbs\Music\Artists ) echo.if NOT EXIST "%THUMBSFOLDER%" ( echo Error! echo The specified Thumb-folder appears to not exist. Please check. pause goto :eof)if NOT DEFINED MUSICFOLDER ( echo No Music-Folder specified, using "%cd%" instead. set /p NOFOLDER="Continue? (Y/N) " ) IF /I "%NOFOLDER%"=="y" ( set MUSICFOLDER=%cd% )IF /I "%NOFOLDER%"=="n" ( echo Cancel Operation goto :eof ) if NOT EXIST "%MUSICFOLDER%" ( echo Error! echo The specified Music-folder appears to not exist. Please check. pause goto :eof) echo.set /p INPUT="Hide all Thumbs? (Y/N) "echo Start at %time% > %MUSICFOLDER%\log.txtecho. >> %MUSICFOLDER%\log.txtset /a NUMBEROFFOLDERS=0set /a NUMBERIDLE=0set /a NUMBERCOPIED=0set /a NUMBERUNAVIALABLE=0FOR /d %%a IN ("%MUSICFOLDER%\*") DO ( set /a NUMBERFOLDERS+=1 IF NOT EXIST "%%a\folder.jpg" ( IF EXIST "%THUMBSFOLDER%\%%~nxaL.jpg" ( copy "%THUMBSFOLDER%\%%~nxaL.jpg" "%%a\folder.jpg" IF /I "%INPUT%"=="y" attrib +h "%%a\folder.jpg" echo OK -- Artist: "%%~nxa" echo Artist: "%%~nxa" >> %MUSICFOLDER%\log.txt echo Result: Thumb successfully copied>> %MUSICFOLDER%\log.txt echo. >> %MUSICFOLDER%\log.txt set /a NUMBERCOPIED+=1 ) ELSE ( echo ?? -- Artist: "%%~nxa" echo Artist: "%%~nxa" >> %MUSICFOLDER%\log.txt echo Result: No Thumb available>> %MUSICFOLDER%\log.txt echo. >> %MUSICFOLDER%\log.txt set /a NUMBERUNAVIALABLE+=1 ) ) ELSE ( IF /I "%INPUT%"=="y" attrib +h "%%a\folder.jpg" echo OK -- Artist: "%%~nxa" echo Artist: "%%~nxa" >> %MUSICFOLDER%\log.txt echo Result: Thumb already exists >> %MUSICFOLDER%\log.txt echo. >> %MUSICFOLDER%\log.txt set /a NUMBERIDLE+=1 ))echo END at %time% >> %MUSICFOLDER%\log.txtecho. >> %MUSICFOLDER%\log.txtecho Folders processed: %NUMBERFOLDERS% >> %MUSICFOLDER%\log.txtecho Thumbs copied: %NUMBERCOPIED% >> %MUSICFOLDER%\log.txtecho Thumbs already present: %NUMBERIDLE% >> %MUSICFOLDER%\log.txtecho Thumbs not found: %NUMBERUNAVIALABLE% >> %MUSICFOLDER%\log.txtecho.echo %NUMBERFOLDERS% Folders processedecho -- %NUMBERCOPIED% Thumbs createdecho -- %NUMBERIDLE% already existedecho -- %NUMBERUNAVIALABLE% were not found in Thumbs-Folderpause[/CODE][/SPOILER]
Hi there,
I created a little Batch-Script that I'd like to share. It scans your Music-Folder and creates Folder thumbs for your Artists-Folders using your Mediaportal Thumbs-Folder. Additionally, you can choose if all thumbnails should be set as hidden.
So your Music Folder that may look like this
[ATTACH]188753[/ATTACH]
might look like this
[ATTACH]188752[/ATTACH]
If the folder already contains a "folder.jpg"-File, it will be left unchanged. A log is created to keep track what the script did.
Instructions:
Save the .bat in your Music-Folder, run it and follow the instructions.
If you are using a custom Thumbs-Folder (other than "C:\ProgramData\Team MediaPortal\MediaPortal\Thumbs\Music\Artists") set it in the beginning of the .bat-File after "THUMBSFOLDER=" like this:
[CODE]set THUMBSFOLDER=Q:\Some random\custom\path[/CODE].
You can also specify the Music-Folder in the .bat-File, so you can save the File somewhere else, in a similar fashion:
[CODE]set MUSICFOLDER=M:\My Music Folder[/CODE]
For those two options please make sure that the path does not end with a backslash and is not encased in quotation-marks.
[SPOILER="Source-Code"]
[CODE=WinBatch]@echo off
:: Add the Path to your MediaPortal-Thumbsfolder (no backslash at the end)
set THUMBSFOLDER=
:: Add the Path to your Music-Folder (no backslash at the end)
set MUSICFOLDER=
:: =======================================================================================
echo Music-Folder-Artist-Thumb-Creator (v1.0)
echo -- by bta489 ---------------------------
echo.
if NOT DEFINED THUMBFOLDER (
set THUMBSFOLDER=C:\ProgramData\Team MediaPortal\MediaPortal\Thumbs\Music\Artists
)
if NOT EXIST "%THUMBSFOLDER%" (
echo Error!
echo The specified Thumb-folder appears to not exist. Please check.
pause
goto :eof
if NOT DEFINED MUSICFOLDER (
echo No Music-Folder specified, using "%cd%" instead.
set /p NOFOLDER="Continue? (Y/N) "
IF /I "%NOFOLDER%"=="y" (
set MUSICFOLDER=%cd%
IF /I "%NOFOLDER%"=="n" (
echo Cancel Operation
if NOT EXIST "%MUSICFOLDER%" (
echo The specified Music-folder appears to not exist. Please check.
set /p INPUT="Hide all Thumbs? (Y/N) "
echo Start at %time% > %MUSICFOLDER%\log.txt
echo. >> %MUSICFOLDER%\log.txt
set /a NUMBEROFFOLDERS=0
set /a NUMBERIDLE=0
set /a NUMBERCOPIED=0
set /a NUMBERUNAVIALABLE=0
FOR /d %%a IN ("%MUSICFOLDER%\*") DO (
set /a NUMBERFOLDERS+=1
IF NOT EXIST "%%a\folder.jpg" (
IF EXIST "%THUMBSFOLDER%\%%~nxaL.jpg" (
copy "%THUMBSFOLDER%\%%~nxaL.jpg" "%%a\folder.jpg"
IF /I "%INPUT%"=="y" attrib +h "%%a\folder.jpg"
echo OK -- Artist: "%%~nxa"
echo Artist: "%%~nxa" >> %MUSICFOLDER%\log.txt
echo Result: Thumb successfully copied>> %MUSICFOLDER%\log.txt
set /a NUMBERCOPIED+=1
) ELSE (
echo ?? -- Artist: "%%~nxa"
echo Result: No Thumb available>> %MUSICFOLDER%\log.txt
set /a NUMBERUNAVIALABLE+=1
echo Result: Thumb already exists >> %MUSICFOLDER%\log.txt
set /a NUMBERIDLE+=1
echo END at %time% >> %MUSICFOLDER%\log.txt
echo Folders processed: %NUMBERFOLDERS% >> %MUSICFOLDER%\log.txt
echo Thumbs copied: %NUMBERCOPIED% >> %MUSICFOLDER%\log.txt
echo Thumbs already present: %NUMBERIDLE% >> %MUSICFOLDER%\log.txt
echo Thumbs not found: %NUMBERUNAVIALABLE% >> %MUSICFOLDER%\log.txt
echo %NUMBERFOLDERS% Folders processed
echo -- %NUMBERCOPIED% Thumbs created
echo -- %NUMBERIDLE% already existed
echo -- %NUMBERUNAVIALABLE% were not found in Thumbs-Folder
pause[/CODE]
[/SPOILER]