7 Commits

Author SHA1 Message Date
Relationship 3fe601c06e Add files via upload 2026-07-10 10:30:32 +01:00
Relationship ab59d1edf3 Add files via upload 2026-07-10 10:28:47 +01:00
Relationship 2c6a429188 Add files via upload 2026-07-06 06:49:50 +01:00
Relationship 5627be8907 Delete RelationshipsJukeBox.toc 2026-07-06 06:49:30 +01:00
Relationship 6f30434002 Delete GeneratePlaylist.ps1 2026-07-06 06:49:20 +01:00
Relationship a4f8a9d297 Delete GeneratePlaylist.bat 2026-07-06 06:49:13 +01:00
Relationship 89b57f2f65 Delete Core.lua 2026-07-06 06:49:07 +01:00
4 changed files with 1735 additions and 558 deletions
+748 -145
View File
File diff suppressed because it is too large Load Diff
+5 -116
View File
@@ -1,122 +1,11 @@
@echo off @echo off
setlocal echo ============================================================
echo Relationships Jukebox - Playlist Generator
REM -- Strip trailing backslash from %~dp0 to avoid "Illegal characters in path" -- echo ============================================================
set "ROOT=%~dp0"
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. echo.
REM -- Fallback: Use bitsadmin or certutil to download ffmpeg if needed -- REM Pass any command-line arguments (e.g. -UseWinRAR) to the PS1 script
REM -- This provides at least some progress output when PowerShell fails -- powershell -ExecutionPolicy Bypass -File "%~dp0GeneratePlaylist.ps1" %*
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.
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 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
+885 -200
View File
File diff suppressed because it is too large Load Diff
+1 -1
View File
@@ -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.4
## 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