Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @echo off
- set "_temp="
- md _REN_albums 2>nul
- for /d %%g in ("albums\*") do (
- call :get_album2 "%%g"
- for %%h in ("%%g\*.mp3") do call :get_songs "%%h"
- )
- pause&exit
- :get_album2
- set _cd=0
- set "_album=%~1"
- set "_album=%_album:albums\=%"
- if not "%_album%"=="%_album: CD1=%" set "_album=%_album: CD1=%"&set _cd=1&goto get_album_next
- if not "%_album%"=="%_album: CD2=%" set "_album=%_album: CD2=%"&set _cd=2&goto get_album_next
- if not "%_album%"=="%_album: CD3=%" set "_album=%_album: CD3=%"&set _cd=3&goto get_album_next
- if not "%_album%"=="%_album: CD4=%" set "_album=%_album: CD4=%"&set _cd=4&goto get_album_next
- :get_album_next
- REM //will only count first album
- if not "%_temp%"=="%_album%" (
- set "_temp=%_album%" & set /a _count=1
- )else (
- if not exist "_REN_albums\%_album%\folder_cd%_cd%.jpg" copy /y "%~1\folder.jpg" "_REN_albums\%_album%\folder_cd%_cd%.jpg"
- exit /b
- )
- REM //detect track format from frist album, and first track
- set _trim=0
- if exist "%~1\001 -*" set _trim=3
- if exist "%~1\01 -*" set _trim=2
- if exist "%~1\1 -*" set _trim=1
- md "_REN_albums\%_album%" 2>nul
- REM //copy image from CD1
- copy /y "%~1\folder.jpg" "_REN_albums\%_album%\folder.jpg"
- exit /b
- :get_songs
- set "_song=%~n1"
- if %_trim% equ 0 goto get_song_next
- if %_trim% equ 2 set "_song=%_song:~2%"&goto get_song_next
- if %_trim% equ 3 set "_song=%_song:~3%"&goto get_song_next
- if "-"=="%_song:~2,1%" (
- echo %_song:~3,1% "%_song%"
- set "_song=%_song:~1%"
- )else (
- set "_song=%_song:~2%"
- )
- :get_song_next
- copy "%~1" "_REN_albums\%_album%\%_count%%_song%.mp3" >nul
- set /a _count+=1
- exit /b
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement