@echo off
rem run.bat  -  Windows wrapper that Synchronet (or Mystic) calls instead
rem of invoking sixeldoor.exe directly. Sets PATH so yt-dlp.exe and
rem ffmpeg.exe are found, plus the env vars the door needs.
rem
rem Deploy on the Windows BBS server (NOT on the dev machine):
rem   copy run.bat sixeldoor.exe  C:\sbbs\xtrn\ytube\
rem   notepad  C:\sbbs\xtrn\ytube\run.bat    <-- edit SIXELDOOR_HOSTNAME
rem
rem Then in scfg:
rem   Command Line: C:\sbbs\xtrn\ytube\run.bat %f

rem ----------- EDIT THESE -----------

rem Your BBS's public hostname or IP. Users open audio URLs like
rem   http://%SIXELDOOR_HOSTNAME%:%SIXELDOOR_AUDIO_PORT%/a/<token>
rem on their phone, so it MUST resolve from outside your LAN.
set SIXELDOOR_HOSTNAME=bbs.example.com

rem Port for the out-of-band audio HTTP server. Must be open in Windows
rem Firewall (netsh advfirewall firewall add rule...).
set SIXELDOOR_AUDIO_PORT=18080

rem Where you unpacked ffmpeg and put yt-dlp. Adjust to match your install.
rem Keep trailing semicolons. If you just dropped the exes next to
rem sixeldoor.exe you can leave both lines pointing at "%~dp0".
set "FFMPEG_DIR=%~dp0"
set "YTDLP_DIR=%~dp0"

rem ----------- /edit zone -----------

set "PATH=%FFMPEG_DIR%;%YTDLP_DIR%;%PATH%"

rem Launch the door with whatever %f (dropfile path) Synchronet passed us.
"%~dp0sixeldoor.exe" %*
