From 2fdc9bf0e9cb44957a5eaf9f128c775329315f68 Mon Sep 17 00:00:00 2001 From: Matthew Stratford Date: Thu, 2 Sep 2021 00:35:03 +0100 Subject: [PATCH 1/5] Reinitialise audio output on every load, to fix silent channels. --- player.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/player.py b/player.py index 3f76b9d..db0dec8 100644 --- a/player.py +++ b/player.py @@ -394,9 +394,13 @@ class Player: def load(self, weight: int): if not self.isPlaying: + loaded_state = self.state.get() self.unload() - showplan = self.state.get()["show_plan"] + self.logger.log.info("Resetting output (in case of sound output gone silent somehow) to " + str(loaded_state["output"])) + self.output(loaded_state["output"]) + + showplan = loaded_state["show_plan"] loaded_item: Optional[PlanItem] = None From f44d22aad3239772ae425a795b7d0b65c321ffce Mon Sep 17 00:00:00 2001 From: Matthew Stratford Date: Thu, 30 Sep 2021 20:46:51 +0100 Subject: [PATCH 2/5] Fix presenter subdirectory. --- web_server.py | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/web_server.py b/web_server.py index 521f6f0..829815b 100644 --- a/web_server.py +++ b/web_server.py @@ -319,9 +319,15 @@ async def audio_file(request, type: str, id: int): # Static Files app.static("/favicon.ico", resolve_local_file_path("ui-static/favicon.ico"), name="ui-favicon") app.static("/static", resolve_local_file_path("ui-static"), name="ui-static") -app.static("/presenter/", resolve_local_file_path("presenter-build/index.html"), - strict_slashes=True, name="presenter-index") -app.static("/presenter/", resolve_local_file_path("presenter-build")) + +dist_directory = resolve_local_file_path("presenter-build") +app.static("/presenter", dist_directory) +app.static( + "/presenter/", + resolve_local_file_path("presenter-build/index.html"), + strict_slashes=True, + name="presenter-index", +) # Helper Functions From 3f1e73930dbbb07fb2909452c82ae8fae9a5ce02 Mon Sep 17 00:00:00 2001 From: Matthew Stratford Date: Thu, 30 Sep 2021 23:51:13 +0100 Subject: [PATCH 3/5] Bump to 3.0.1 --- package-lock.json | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/package-lock.json b/package-lock.json index 939f4ff..1ee38e5 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,5 +1,5 @@ { "name": "bapsicle", - "version": "3.0.0", + "version": "3.0.1", "lockfileVersion": 1 } diff --git a/package.json b/package.json index 6cfd2ff..0377273 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "bapsicle", "nice_name": "BAPSicle", - "version": "3.0.0", + "version": "3.0.1", "description": "BAPS3, the third generation of University Radio York's Broadcast and Presenting Suite. This package includes the Server (BAPSicle) and Presenter (WebStudio)", "main": "index.js", "directories": { From 570077a3aacdfbd92d98879fe7811477f8aada19 Mon Sep 17 00:00:00 2001 From: Matthew Stratford Date: Fri, 1 Oct 2021 00:08:24 +0100 Subject: [PATCH 4/5] Fix websocket serve change. --- websocket_server.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/websocket_server.py b/websocket_server.py index 594b552..4622480 100644 --- a/websocket_server.py +++ b/websocket_server.py @@ -7,7 +7,7 @@ from typing import List import websockets import json from os import _exit -from websockets.server import Serve +from websockets.server import serve from setproctitle import setproctitle from multiprocessing import current_process @@ -25,7 +25,7 @@ class WebsocketServer: logger: LoggingManager to_webstudio: Task from_webstudio: Task - websocket_server: Serve + websocket_server: serve def __init__(self, in_q, out_q, state): From 6e921f6c9b4bea375686d09d07976ee8ed580a70 Mon Sep 17 00:00:00 2001 From: Matthew Stratford Date: Fri, 1 Oct 2021 00:30:30 +0100 Subject: [PATCH 5/5] Force sanic / cors to fix init error. --- build/requirements.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/build/requirements.txt b/build/requirements.txt index b01b08a..9830b7d 100644 --- a/build/requirements.txt +++ b/build/requirements.txt @@ -1,7 +1,7 @@ autopep8 pygame==2.0.1 -sanic -sanic-cors +sanic==21.3.4 +sanic-Cors==1.0.0 syncer aiohttp mutagen