@ECHO OFF SET "FCDHOME=%~dp0" SET FCDERROR=0 IF [%1] == [] ( Echo. Echo ########################################################### Echo # Echo # This program is meant to be run via MePo Tools Echo # Echo # If you want to test the fakecd process then run Echo # fakecd - test run.cmd Echo # Echo ########################################################### Echo. Echo. echo. >> "%FCDHOME%fakecd.log" echo User attempted to run fakecd.cmd with no valid parameters >> "%FCDHOME%fakecd.log" echo COM: "%FCDHOME%fakecd.cmd" %* >> "%FCDHOME%fakecd.log" ping -n 4 localhost >nul 2>&1 SET FCDERROR=1 goto theend ) REM ############################################# REM # Expected Useage: REM # Fakecmd.cmd "%t" "%s" %rm %ns REM ############################################# REM MTV: Create TV Series Disc from TV Series Fanart REM MTV ##: Create TV Series Season Disc REM MVM: Create Movie Disc from Movie Fanart REM MAM: Create Music Disc from Album Cover REM ############################################# echo COM: "%FCDHOME%fakecd.cmd" %* >> "%FCDHOME%fakecd.log" echo INPUT: %1 >> "%FCDHOME%fakecd.log" echo OUTPUT: %2 >> "%FCDHOME%fakecd.log" IF NOT EXIST %1 ( echo ERROR INPUT FILE DOES NOT EXIST >> "%FCDHOME%fakecd.log" SET FCDERROR=1 goto theend ) IF "%3"=="MTV" goto :series IF "%3"=="MVM" goto :movies IF "%3"=="MAM" goto :music echo ERROR NO TYPE SPECIFIED [MTV/MVM/MAM] >> "%FCDHOME%fakecd.log" SET FCDERROR=2 goto theend REM ############################################# REM Create TV Series Disc REM ############################################# :series SET "SEASON=SEASON %4" IF [%4] == [] SET "SEASON=SEASON NULL" IF [%4] == [0] SET "SEASON=SPECIAL EPISODES" IF [%4] == [1] SET "SEASON=SEASON ONE" IF [%4] == [2] SET "SEASON=SEASON TWO" IF [%4] == [3] SET "SEASON=SEASON THREE" IF [%4] == [4] SET "SEASON=SEASON FOUR" IF [%4] == [5] SET "SEASON=SEASON FIVE" IF [%4] == [6] SET "SEASON=SEASON SIX" IF [%4] == [7] SET "SEASON=SEASON SEVEN" IF [%4] == [8] SET "SEASON=SEASON EIGHT" IF [%4] == [9] SET "SEASON=SEASON NINE" IF [%4] == [10] SET "SEASON=SEASON TEN" IF [%4] == [11] SET "SEASON=SEASON ELEVEN" IF [%4] == [12] SET "SEASON=SEASON TWELVE" IF [%4] == [13] SET "SEASON=SEASON THIRTEEN" IF [%4] == [14] SET "SEASON=SEASON FOURTEEN" IF [%4] == [15] SET "SEASON=SEASON FIFTEEN" IF [%4] == [16] SET "SEASON=SEASON SIXTEEN" IF [%4] == [17] SET "SEASON=SEASON SEVENTEEN" IF [%4] == [18] SET "SEASON=SEASON EIGHTEEN" IF [%4] == [19] SET "SEASON=SEASON NINETEEN" IF [%4] == [20] SET "SEASON=SEASON TWENTY" echo SERIES [%season%] >> "%FCDHOME%fakecd.log" if "%season%"=="SEASON NULL" ( "%FCDHOME%Files\convert.exe" %1 -resize 1778x1778 ^ -gravity center -crop 1000x1000+0+0 +repage ^ "%FCDHOME%Files\fanart.mask.png" -alpha off -compose copy_opacity -composite "%FCDHOME%Files\fanart.series.png" -compose over -composite ^ %2 GOTO :THEEND) "%FCDHOME%Files\convert.exe" ^ %1 -resize 1778x1778 ^ -gravity center -crop 1000x1000+0+0 +repage ^ "%FCDHOME%Files\fanart.mask.png" -alpha off -compose copy_opacity -composite ^ "%FCDHOME%Files\fanart.season.png" -compose over -composite ^ -background transparent -fill white ^ -font segoe-ui-bold -pointsize 72 -gravity center -size 1000x98 ^ label:"%season%" ^ -geometry +0+724 ^ -gravity north ^ -composite ^ %2 goto :theend REM ############################################# REM Create Movie Disc REM ############################################# :movies echo MOVIES >> "%FCDHOME%fakecd.log" echo MOVIE: Title %title%, Cert %5, Res %6, Video %7, Audio %8, Audio %9 set "movie.input=%1" set "movie.output=%2" set "movie.title=%4" echo MOVIE TITLE: [%movie.title%] set "movie.certification=%5" set movie.certification=%movie.certification:~1,-1% echo movie.certification: [%movie.certification%] IF EXIST "%FCDHOME%Files\Logos.Other\Certification\%movie.certification%.png" ( set "movie.certification=%FCDHOME%Files\Logos.Other\Certification\%movie.certification%.png" ) ELSE ( set "movie.certification=%FCDHOME%Files\blank.png" echo Certification: %5 >> "%FCDHOME%Missing\codecs.txt" ) echo movie.certification: [%movie.certification%] set "movie.resolution=%6" set movie.resolution=%movie.resolution:~1,-1% echo movie.resolution: [%movie.resolution%] IF EXIST "%FCDHOME%Files\Logos.Right\Resolution\%movie.resolution%.png" ( set "movie.resolution=%FCDHOME%Files\Logos.Right\Resolution\%movie.resolution%.png" ) ELSE ( set "movie.resolution=%FCDHOME%Files\blank.png" echo Resolution: %6 >> "%FCDHOME%Missing\codecs.txt" ) echo movie.resolution: [%movie.resolution%] set "movie.source=%6" set movie.source=%movie.source:~1,-1% echo movie.source: [%movie.source%] IF EXIST "%FCDHOME%Files\Logos.Other\Source\%movie.source%.png" ( set "movie.source=%FCDHOME%Files\Logos.Other\Source\%movie.source%.png" ) ELSE ( set "movie.source=%FCDHOME%Files\blank.png" ) echo movie.source: [%movie.source%] set "movie.video.codec=%7" set movie.video.codec=%movie.video.codec:~1,-1% echo movie.video.codec: [%movie.video.codec%] IF EXIST "%FCDHOME%Files\Logos.Right\Video.codec\%movie.video.codec%.png" ( set "movie.video.codec=%FCDHOME%Files\Logos.Right\Video.Codec\%movie.video.codec%.png" ) ELSE ( set "movie.video.codec=%FCDHOME%Files\blank.png" echo Video Codec: %5 >> "%FCDHOME%Missing\codecs.txt" ) echo movie.video.codec: [%movie.video.codec%] set "movie.audio.codec=%8" set movie.audio.codec=%movie.audio.codec:~1,-1% echo movie.audio.codec: [%movie.audio.codec%] IF EXIST "%FCDHOME%Files\Logos.Right\audio\%movie.audio.codec%.png" ( set "movie.audio.codec=%FCDHOME%Files\Logos.Right\Audio\%movie.audio.codec%.png" ) ELSE ( set "movie.audio.codec=%FCDHOME%Files\blank.png" echo Audio Codec: %8 >> "%FCDHOME%Missing\codecs.txt" ) echo movie.audio.codec: [%movie.audio.codec%] set "movie.audio.channel=%9" set movie.audio.channel=%movie.audio.channel:~1,-1% echo movie.audio.channel: [%movie.audio.channel%] IF EXIST "%FCDHOME%Files\Logos.Right\audio\%movie.audio.channel%.png" ( set "movie.audio.channel=%FCDHOME%Files\Logos.Right\audio\%movie.audio.channel%.png" ) ELSE ( set "movie.audio.channel=%FCDHOME%Files\blank.png" echo Audio Channel: %9 >> "%FCDHOME%Missing\codecs.txt" ) echo movie.audio.channel: [%movie.audio.channel%] REM STUDIO SHIFT SHIFT SHIFT set "movie.studio.1=%7" set "movie.studio.2=%8" set "movie.studio.3=%9" set movie.studio.1=%movie.studio.1:~1,-1% set movie.studio.2=%movie.studio.2:~1,-1% set movie.studio.3=%movie.studio.3:~1,-1% echo Studio1: [%movie.studio.1%] echo Studio2: [%movie.studio.2%] echo Studio3: [%movie.studio.3%] IF NOT EXIST "%FCDHOME%Files\Logos.Right\studio\%movie.studio.1%.png" ( echo %movie.studio.1% >> "%FCDHOME%Missing\studios.txt" ) IF NOT EXIST "%FCDHOME%Files\Logos.Right\studio\%movie.studio.2%.png" ( echo %movie.studio.2% >> "%FCDHOME%Missing\studios.txt" ) IF NOT EXIST "%FCDHOME%Files\Logos.Right\studio\%movie.studio.3%.png" ( echo %movie.studio.3% >> "%FCDHOME%Missing\studios.txt" ) REM ROTATE STUDIOS SO THAT ONE EXISTS AND TWO MAYBE EXISTS IF EXIST "%FCDHOME%Files\Logos.Right\studio\%movie.studio.1%.png" ( set "movie.studio.1=%movie.studio.1%" ) ELSE ( set "movie.studio.1=%movie.studio.2%" ) IF EXIST "%FCDHOME%Files\Logos.Right\studio\%movie.studio.1%.png" ( set "movie.studio.1=%movie.studio.1%" ) ELSE ( set "movie.studio.1=%movie.studio.3%" ) IF "%movie.studio.1%"=="%movie.studio.2%" ( set "movie.studio.2=%movie.studio.3%" ) IF "%movie.studio.1%"=="%movie.studio.2%" ( set "movie.studio.2=null" ) IF EXIST "%FCDHOME%Files\Logos.Right\studio\%movie.studio.2%.png" ( set "movie.studio.2=%movie.studio.2%" ) ELSE ( set "movie.studio.2=%movie.studio.3%" ) IF "%movie.studio.1%"=="%movie.studio.2%" ( set "movie.studio.2=null" ) REM CREATE FILENAMES IF EXIST "%FCDHOME%Files\Logos.Right\studio\%movie.studio.1%.png" ( set "movie.studio.1=%FCDHOME%Files\Logos.Right\studio\%movie.studio.1%.png" ) ELSE ( set "movie.studio.1=%FCDHOME%Files\blank.png" ) IF EXIST "%FCDHOME%Files\Logos.Right\studio\%movie.studio.2%.png" ( set "movie.studio.2=%FCDHOME%Files\Logos.Right\studio\%movie.studio.2%.png" ) ELSE ( set "movie.studio.2=%FCDHOME%Files\blank.png" ) echo Studio1: [%movie.studio.1%] echo Studio2: [%movie.studio.2%] "%FCDHOME%Files\convert.exe" ^ -background black -fill white -font segoe-ui-bold -gravity center -size 780x58 ^ label:%movie.title% ^ -bordercolor black -border 110x0 ^ "%FCDHOME%Files\text.mask.png" -alpha off -compose copy_opacity -composite ^ "%FCDHOME%Files\text.temp.png" "%FCDHOME%Files\convert.exe" ^ %movie.input% -resize 1778x1778 ^ -gravity center -crop 1000x1000+0+0 +repage ^ "%FCDHOME%Files\fanart.mask.png" -alpha off -compose copy_opacity -composite ^ "%FCDHOME%Files\fanart.movie.png" -compose over -composite ^ -gravity northwest ^ "%movie.audio.channel%" -geometry +670+650 -composite ^ "%movie.audio.codec%" -geometry +700+570 -composite ^ "%movie.video.codec%" -geometry +720+490 -composite ^ "%movie.resolution%" -geometry +713+410 -composite ^ "%movie.studio.1%" -geometry +695+330 -composite ^ "%movie.studio.2%" -geometry +665+250 -composite ^ "%movie.certification%" -geometry +30+450 -composite ^ "%movie.source%" -geometry +359+800 -composite ^ "%FCDHOME%Files\text.temp.png" -geometry +0+728 -composite ^ %movie.output% del "%FCDHOME%Files\text.temp.png" goto :theend REM ############################################# REM Create Music Disc REM ############################################# :music set str1=%1 if x%str1:fanart=%==x%str1% ( echo MUSIC [ALBUM ART]>> "%FCDHOME%fakecd.log" "%FCDHOME%Files\convert.exe" %1 -resize 1000x1000! ^ -gravity center -crop 1000x1000+0+0 +repage ^ "%FCDHOME%Files\musicalbum.mask.png" -alpha off -compose copy_opacity -composite "%FCDHOME%Files\musicalbum.overlay.png" -compose over -composite ^ %2 ) ELSE ( echo MUSIC [FANART]>> "%FCDHOME%fakecd.log" "%FCDHOME%Files\convert.exe" %1 -resize 1778x1778 ^ -gravity center -crop 1000x1000+0+0 +repage ^ "%FCDHOME%Files\musicalbum.mask.png" -alpha off -compose copy_opacity -composite "%FCDHOME%Files\musicalbum.overlay.png" -compose over -composite ^ %2 ) goto :theend REM ############################################# REM THE END REM ############################################# :theend echo. >> "%FCDHOME%fakecd.log" EXIT /B %FCDERROR%