Compare commits
12 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| bc9d5f520b | |||
| 8b00f6df15 | |||
| 8fe76559a2 | |||
| b804d2ce13 | |||
| b772223dc2 | |||
| 3fe601c06e | |||
| ab59d1edf3 | |||
| 2c6a429188 | |||
| 5627be8907 | |||
| 6f30434002 | |||
| a4f8a9d297 | |||
| 89b57f2f65 |
+6
-117
@@ -1,122 +1,11 @@
|
|||||||
@echo off
|
@echo off
|
||||||
setlocal
|
echo ============================================================
|
||||||
|
echo Relationships Jukebox - Playlist Generator
|
||||||
|
echo ============================================================
|
||||||
|
echo.
|
||||||
|
|
||||||
REM -- Strip trailing backslash from %~dp0 to avoid "Illegal characters in path" --
|
REM Pass any command-line arguments (e.g. -UseWinRAR) to the PS1 script
|
||||||
set "ROOT=%~dp0"
|
powershell -ExecutionPolicy Bypass -File "%~dp0GeneratePlaylist.ps1" %*
|
||||||
if "%ROOT:~-1%"=="\" set "ROOT=%ROOT:~0,-1%"
|
|
||||||
|
|
||||||
REM -- If a local ffmpeg folder exists inside the addon, prepend it to PATH --
|
|
||||||
REM This ensures the PS1 script's Find-Ffmpeg can discover it even if
|
|
||||||
REM it isn't on the system PATH yet.
|
|
||||||
if exist "%ROOT%\ffmpeg\ffmpeg.exe" (
|
|
||||||
set "PATH=%ROOT%\ffmpeg;%PATH%"
|
|
||||||
)
|
|
||||||
|
|
||||||
REM -- Check for -UseWinRAR flag --
|
|
||||||
set "PS_ARGS=-NoProfile -ExecutionPolicy Bypass -File "%ROOT%\GeneratePlaylist.ps1" -RootPath "%ROOT%""
|
|
||||||
if "%1"=="-UseWinRAR" (
|
|
||||||
set "PS_ARGS=-NoProfile -ExecutionPolicy Bypass -File "%ROOT%\GeneratePlaylist.ps1" -RootPath "%ROOT%" -UseWinRAR"
|
|
||||||
)
|
|
||||||
if "%1"=="-usewinrar" (
|
|
||||||
set "PS_ARGS=-NoProfile -ExecutionPolicy Bypass -File "%ROOT%\GeneratePlaylist.ps1" -RootPath "%ROOT%" -UseWinRAR"
|
|
||||||
)
|
|
||||||
|
|
||||||
powershell %PS_ARGS%
|
|
||||||
set "ERR=%ERRORLEVEL%"
|
|
||||||
|
|
||||||
if not "%ERR%"=="0" (
|
|
||||||
echo.
|
|
||||||
echo GeneratePlaylist failed with exit code %ERR%.
|
|
||||||
echo.
|
|
||||||
echo Trying fallback download method...
|
|
||||||
echo.
|
|
||||||
|
|
||||||
REM -- Fallback: Use bitsadmin or certutil to download ffmpeg if needed --
|
|
||||||
REM -- This provides at least some progress output when PowerShell fails --
|
|
||||||
|
|
||||||
set "FFMPEG_DIR=%ROOT%\ffmpeg"
|
|
||||||
if not exist "%FFMPEG_DIR%\ffmpeg.exe" (
|
|
||||||
echo ffmpeg not found. Attempting fallback download...
|
|
||||||
echo.
|
|
||||||
|
|
||||||
set "DL_DIR=%ROOT%\ffmpeg_download"
|
|
||||||
if not exist "%DL_DIR%" mkdir "%DL_DIR%"
|
|
||||||
|
|
||||||
REM -- Try bitsadmin (available on most Windows systems) --
|
|
||||||
where bitsadmin >nul 2>nul
|
|
||||||
if %ERRORLEVEL%==0 (
|
|
||||||
echo Using bitsadmin to download ffmpeg...
|
|
||||||
echo This may take several minutes depending on your connection.
|
|
||||||
echo.
|
|
||||||
bitsadmin /transfer "ffmpeg_download" /priority normal "https://www.gyan.dev/ffmpeg/builds/ffmpeg-release-essentials.zip" "%DL_DIR%\ffmpeg.zip"
|
|
||||||
if exist "%DL_DIR%\ffmpeg.zip" (
|
|
||||||
echo.
|
|
||||||
echo Download complete. Extracting ffmpeg.zip with PowerShell...
|
|
||||||
powershell -NoProfile -Command "Expand-Archive -LiteralPath '%DL_DIR%\ffmpeg.zip' -DestinationPath '%DL_DIR%\extracted' -Force; $bin = Get-ChildItem '%DL_DIR%\extracted' -Recurse -Directory -Filter 'bin' | Select-Object -First 1; if ($bin) { if (-not (Test-Path '%FFMPEG_DIR%')) { New-Item -ItemType Directory -Path '%FFMPEG_DIR%' -Force | Out-Null }; Copy-Item (Join-Path $bin.FullName 'ffmpeg.exe') '%FFMPEG_DIR%\' -Force -ErrorAction SilentlyContinue; Copy-Item (Join-Path $bin.FullName 'ffprobe.exe') '%FFMPEG_DIR%\' -Force -ErrorAction SilentlyContinue }; Remove-Item '%DL_DIR%\extracted' -Recurse -Force -ErrorAction SilentlyContinue; Remove-Item '%DL_DIR%\ffmpeg.zip' -Force -ErrorAction SilentlyContinue"
|
|
||||||
if exist "%FFMPEG_DIR%\ffmpeg.exe" (
|
|
||||||
echo ffmpeg installed successfully via fallback.
|
|
||||||
) else (
|
|
||||||
echo WARNING: Fallback extraction may not have completed successfully.
|
|
||||||
)
|
|
||||||
) else (
|
|
||||||
echo bitsadmin download failed.
|
|
||||||
)
|
|
||||||
) else (
|
|
||||||
echo bitsadmin not available on this system.
|
|
||||||
echo.
|
|
||||||
echo Please install ffmpeg manually:
|
|
||||||
echo 1. Download from https://www.gyan.dev/ffmpeg/builds/
|
|
||||||
echo 2. Extract ffmpeg.exe and ffprobe.exe
|
|
||||||
echo 3. Place them in: %FFMPEG_DIR%
|
|
||||||
)
|
|
||||||
)
|
|
||||||
|
|
||||||
echo.
|
|
||||||
echo Trying to generate playlist without PowerShell...
|
|
||||||
echo.
|
|
||||||
|
|
||||||
REM -- Minimal fallback: just scan Media folder and write AutoPlaylist.lua --
|
|
||||||
REM -- This works without ffmpeg but uses estimated durations --
|
|
||||||
if exist "%ROOT%\Media" (
|
|
||||||
echo Scanning Media folder for audio files...
|
|
||||||
set "OUTFILE=%ROOT%\AutoPlaylist.lua"
|
|
||||||
echo RelationshipsJukeboxAutoPlaylist = {} > "%OUTFILE%"
|
|
||||||
echo RelationshipsJukeboxAutoPlaylist.tracks = { >> "%OUTFILE%"
|
|
||||||
for /r "%ROOT%\Media" %%F in (*.mp3 *.wav *.ogg) do (
|
|
||||||
setlocal enabledelayedexpansion
|
|
||||||
REM Get the full path of the file
|
|
||||||
set "FULLFILE=%%F"
|
|
||||||
REM Strip the ROOT prefix to get a relative path like \Media\song.mp3
|
|
||||||
set "RELPATH=!FULLFILE:%ROOT%=!"
|
|
||||||
REM Build the WoW-relative path: Interface\AddOns\RelationshipsJukeBox\Media\song.mp3
|
|
||||||
REM RELPATH starts with \ (from the remaining path after stripping ROOT)
|
|
||||||
set "FULLPATH=Interface\AddOns\RelationshipsJukeBox!RELPATH!"
|
|
||||||
REM Double all backslashes for Lua string escaping (\\ in source = \ in Lua value)
|
|
||||||
set "FULLPATH=!FULLPATH:\=\\!"
|
|
||||||
set "BASENAME=%%~nF"
|
|
||||||
echo { path = "!FULLPATH!", name = "!BASENAME!", duration = 180 }, >> "%OUTFILE%"
|
|
||||||
endlocal
|
|
||||||
echo Found: %%~nF
|
|
||||||
)
|
|
||||||
echo } >> "%OUTFILE%"
|
|
||||||
echo.
|
|
||||||
echo Playlist generated (using estimated 180s durations).
|
|
||||||
echo Install ffmpeg for accurate durations and MP3 sanitization.
|
|
||||||
) else (
|
|
||||||
echo Media folder not found: %ROOT%\Media
|
|
||||||
)
|
|
||||||
|
|
||||||
echo.
|
|
||||||
echo Usage: GeneratePlaylist.bat [-UseWinRAR]
|
|
||||||
echo -UseWinRAR Prefer WinRAR over 7-Zip for archive extraction
|
|
||||||
pause
|
|
||||||
exit /b %ERR%
|
|
||||||
)
|
|
||||||
|
|
||||||
echo.
|
echo.
|
||||||
echo Playlist entries now include names and durations for Play All / Shuffle.
|
|
||||||
echo Autoplay and Shuffle work even without metadata - estimated durations are used.
|
|
||||||
echo.
|
|
||||||
echo Tip: Run with -UseWinRAR flag to use WinRAR for archive extraction:
|
|
||||||
echo GeneratePlaylist.bat -UseWinRAR
|
|
||||||
pause
|
pause
|
||||||
|
|||||||
+955
-252
File diff suppressed because it is too large
Load Diff
@@ -1,6 +1,6 @@
|
|||||||
<img src="https://cdn.discordapp.com/attachments/1510333697277300856/1523253951594627112/I.png?ex=6a4b704a&is=6a4a1eca&hm=4b4a2c04ae8702c5ff92cc50296ceb65d4c5c13f1174fc767fd7f3c4351337fc&"/>
|
<img src="https://i.postimg.cc/Wb6XLr2N/llll.png"/>
|
||||||
|
|
||||||
<img src="https://cdn.discordapp.com/attachments/1510333697277300856/1523253988269756616/ezgif-1f660e370df27e35.gif?ex=6a4b7053&is=6a4a1ed3&hm=0835c0247c885d0fb6d25b86064a792989ab1d6a8f1c91570b30e7936fc7bd16&"/>
|
<img src="https://i.postimg.cc/xTytDH96/I.gif"/>
|
||||||
|
|
||||||
|
|
||||||
# Relationships Jukebox
|
# Relationships Jukebox
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
## Title: Relationships Jukebox
|
## Title: Relationships Jukebox
|
||||||
## Notes: Simple in-game MP3/WAV/OGG player with GUI.
|
## Notes: Simple in-game MP3/WAV/OGG player with GUI.
|
||||||
## Author: Relationship
|
## Author: Relationship
|
||||||
## Version: 1.2
|
## Version: 1.5
|
||||||
## SavedVariables: RelationshipsJukeboxDB
|
## SavedVariables: RelationshipsJukeboxDB
|
||||||
## X-Website: https://github.com/Relationship-OctoWoW/RelationshipsJukeBox
|
## X-Website: https://github.com/Relationship-OctoWoW/RelationshipsJukeBox
|
||||||
## X-GitHub: https://github.com/Relationship-OctoWoW/RelationshipsJukeBox
|
## X-GitHub: https://github.com/Relationship-OctoWoW/RelationshipsJukeBox
|
||||||
|
|||||||
Reference in New Issue
Block a user