home
products
contribute
download
documentation
forum
Home
Forums
New posts
Search forums
What's new
New posts
All posts
Latest activity
Members
Registered members
Current visitors
Donate
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Search forums
Search titles only
By:
Menu
Log in
Register
Navigation
Install the app
Install
More options
Contact us
Close Menu
Forums
HTPC Projects
Software
Tools and other software
[Batch-Script] Music-Folder-Artist-Thumb-Creator
Contact us
RSS
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
<blockquote data-quote="bta489" data-source="post: 1216922" data-attributes="member: 138471"><p>Hi there,</p><p></p><p>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.</p><p></p><p>So your Music Folder that may look like this</p><p>[ATTACH]188753[/ATTACH] </p><p>might look like this</p><p>[ATTACH]188752[/ATTACH]</p><p></p><p>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.</p><p></p><p>Instructions:</p><p>Save the .bat in your Music-Folder, run it and follow the instructions.</p><p>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:</p><p>[CODE]set THUMBSFOLDER=Q:\Some random\custom\path[/CODE].</p><p>You can also specify the Music-Folder in the .bat-File, so you can save the File somewhere else, in a similar fashion:</p><p>[CODE]set MUSICFOLDER=M:\My Music Folder[/CODE]</p><p></p><p>For those two options please make sure that the path does not end with a backslash and is not encased in quotation-marks.</p><p></p><p>[SPOILER="Source-Code"]</p><p>[CODE=WinBatch]@echo off</p><p></p><p>:: Add the Path to your MediaPortal-Thumbsfolder (no backslash at the end)</p><p>set THUMBSFOLDER=</p><p>:: Add the Path to your Music-Folder (no backslash at the end)</p><p>set MUSICFOLDER=</p><p></p><p>:: =======================================================================================</p><p>echo Music-Folder-Artist-Thumb-Creator (v1.0)</p><p>echo -- by bta489 ---------------------------</p><p>echo.</p><p></p><p></p><p>if NOT DEFINED THUMBFOLDER (</p><p> set THUMBSFOLDER=C:\ProgramData\Team MediaPortal\MediaPortal\Thumbs\Music\Artists</p><p> )</p><p> </p><p>echo.</p><p></p><p>if NOT EXIST "%THUMBSFOLDER%" (</p><p> echo Error!</p><p> echo The specified Thumb-folder appears to not exist. Please check.</p><p> pause</p><p> goto :eof</p><p>)</p><p>if NOT DEFINED MUSICFOLDER (</p><p> echo No Music-Folder specified, using "%cd%" instead.</p><p> set /p NOFOLDER="Continue? (Y/N) "</p><p> )</p><p> </p><p>IF /I "%NOFOLDER%"=="y" (</p><p> set MUSICFOLDER=%cd%</p><p> )</p><p>IF /I "%NOFOLDER%"=="n" (</p><p> echo Cancel Operation</p><p> goto :eof</p><p> )</p><p> </p><p>if NOT EXIST "%MUSICFOLDER%" (</p><p> echo Error!</p><p> echo The specified Music-folder appears to not exist. Please check.</p><p> pause</p><p> goto :eof</p><p>) </p><p> </p><p>echo.</p><p>set /p INPUT="Hide all Thumbs? (Y/N) "</p><p></p><p></p><p>echo Start at %time% > %MUSICFOLDER%\log.txt</p><p>echo. >> %MUSICFOLDER%\log.txt</p><p></p><p>set /a NUMBEROFFOLDERS=0</p><p>set /a NUMBERIDLE=0</p><p>set /a NUMBERCOPIED=0</p><p>set /a NUMBERUNAVIALABLE=0</p><p></p><p>FOR /d %%a IN ("%MUSICFOLDER%\*") DO (</p><p> set /a NUMBERFOLDERS+=1</p><p> IF NOT EXIST "%%a\folder.jpg" (</p><p> IF EXIST "%THUMBSFOLDER%\%%~nxaL.jpg" (</p><p> copy "%THUMBSFOLDER%\%%~nxaL.jpg" "%%a\folder.jpg"</p><p> IF /I "%INPUT%"=="y" attrib +h "%%a\folder.jpg"</p><p> </p><p> echo OK -- Artist: "%%~nxa"</p><p> echo Artist: "%%~nxa" >> %MUSICFOLDER%\log.txt</p><p> echo Result: Thumb successfully copied>> %MUSICFOLDER%\log.txt</p><p> echo. >> %MUSICFOLDER%\log.txt</p><p> set /a NUMBERCOPIED+=1</p><p> ) ELSE (</p><p> echo ?? -- Artist: "%%~nxa"</p><p> </p><p> echo Artist: "%%~nxa" >> %MUSICFOLDER%\log.txt</p><p> echo Result: No Thumb available>> %MUSICFOLDER%\log.txt</p><p> echo. >> %MUSICFOLDER%\log.txt</p><p> set /a NUMBERUNAVIALABLE+=1</p><p> )</p><p> ) ELSE (</p><p> IF /I "%INPUT%"=="y" attrib +h "%%a\folder.jpg"</p><p> echo OK -- Artist: "%%~nxa"</p><p> </p><p> echo Artist: "%%~nxa" >> %MUSICFOLDER%\log.txt</p><p> echo Result: Thumb already exists >> %MUSICFOLDER%\log.txt</p><p> echo. >> %MUSICFOLDER%\log.txt</p><p> set /a NUMBERIDLE+=1</p><p> )</p><p>)</p><p></p><p>echo END at %time% >> %MUSICFOLDER%\log.txt</p><p>echo. >> %MUSICFOLDER%\log.txt</p><p>echo Folders processed: %NUMBERFOLDERS% >> %MUSICFOLDER%\log.txt</p><p>echo Thumbs copied: %NUMBERCOPIED% >> %MUSICFOLDER%\log.txt</p><p>echo Thumbs already present: %NUMBERIDLE% >> %MUSICFOLDER%\log.txt</p><p>echo Thumbs not found: %NUMBERUNAVIALABLE% >> %MUSICFOLDER%\log.txt</p><p></p><p>echo.</p><p>echo %NUMBERFOLDERS% Folders processed</p><p>echo -- %NUMBERCOPIED% Thumbs created</p><p>echo -- %NUMBERIDLE% already existed</p><p>echo -- %NUMBERUNAVIALABLE% were not found in Thumbs-Folder</p><p></p><p>pause[/CODE]</p><p>[/SPOILER]</p></blockquote><p></p>
[QUOTE="bta489, post: 1216922, member: 138471"] 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.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 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.txt echo. >> %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. echo %NUMBERFOLDERS% Folders processed echo -- %NUMBERCOPIED% Thumbs created echo -- %NUMBERIDLE% already existed echo -- %NUMBERUNAVIALABLE% were not found in Thumbs-Folder pause[/CODE] [/SPOILER] [/QUOTE]
Insert quotes…
Verification
Post reply
Forums
HTPC Projects
Software
Tools and other software
[Batch-Script] Music-Folder-Artist-Thumb-Creator
Contact us
RSS
Top
Bottom