Skip to content

Commit f878f46

Browse files
committed
temp fix for SRS 2.3.3.2 issue with external audio
1 parent 1bced1d commit f878f46

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

services/music/radios/srs.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,16 +34,15 @@ async def play(self, file: str) -> None:
3434
self.current = file
3535

3636
def exe_path() -> str:
37-
version = self.server.extensions['SRS'].version
38-
if parse(version) >= parse('2.2.0.0'):
37+
if parse(self.server.extensions['SRS'].version) >= parse('2.2.0.0'):
3938
return os.path.join(srs_inst, "ExternalAudio", "DCS-SR-ExternalAudio.exe")
4039
else:
4140
return os.path.join(srs_inst, "DCS-SR-ExternalAudio.exe")
4241

4342
def run_subprocess() -> subprocess.Popen:
4443
def _log_output(p: subprocess.Popen):
4544
for line in iter(p.stdout.readline, b''):
46-
self.log.debug(line.decode('utf-8').rstrip())
45+
self.log.debug(line.decode('utf-8', errors='replace').rstrip())
4746

4847
debug = self.service.get_config().get('debug', False)
4948
out = subprocess.PIPE if debug else subprocess.DEVNULL
@@ -59,6 +58,10 @@ def _log_output(p: subprocess.Popen):
5958
"-n", self.config.get('display_name', 'DCSSB MusicBox'),
6059
"-i", file
6160
]
61+
# TODO: temporary workaround
62+
if parse(self.server.extensions['SRS'].version) == parse('2.3.3.2'):
63+
args.extend(['--unitId', '1000'])
64+
6265
if debug:
6366
self.log.debug(f"Running {' '.join(args)}")
6467
p = subprocess.Popen(args, stdout=out, stderr=err)

0 commit comments

Comments
 (0)