Intermediate commits (oldest → newest):
- Hit list queue for radio
- fix
- Documentation of conjurer_librarian
- Reformatting of conjurer_librarian
- Documentation of conjurer_musician
- Formatting of conjurer_musician
- Documentation of radio_conjurer.liq
- Merge branch 'main' of https://github.com/migatu/conjurer
- Removal from tracking
- Fixing librarian result (#6)
- Potential bugfix for some lazycoding in spotipy... Another one. fuck it
- Music tunneling (#7)
- Even more logging in spotify download
- test requests
- Fine tuning
- Optimization bug fix #1
- Fix crossfade
- Crossfadeing ctnd
- Fix
- Starting work on librarian headless mode
This commit is contained in:
2025-10-30 16:59:00 +01:00
parent 806cada1c1
commit a8797df45c
20 changed files with 1161 additions and 509 deletions
+24
View File
@@ -13,6 +13,22 @@ IN_COMM_Q = Queue()
awaiting_q = []
incoming_q = Queue()
app = Flask(__name__)
class QueryControl:
"""
This class `QueryControl` is used to manage queries with information about the author, UUID,
content, logger, context, and replies.
"""
def __init__(self, query_author, query_uuid, query_content, uplogger, ctx) -> None:
self.author = query_author
self.uuid = query_uuid
self.content = query_content
self.logger = uplogger
self.stop = False
self.ctx = ctx
self.logger.info(
f"Created Query control for {self.author}, {self.uuid}: {self.content}"
)
self.replies = []
@app.route("/conjurer", methods=["POST"])
def answer_external_command():
@@ -86,8 +102,16 @@ def scan_incoming(_logger):
try:
answer = incoming_q.get(block=False)
_logger.info("DATA FOUND")
record_stored = False
for record in awaiting_q:
if record.uuid in answer.keys():
record_stored = True
record.stop = True
record.entries = answer[record.uuid]
IN_COMM_Q.put(record)
if not record_stored:
for key in answer.keys():
record = QueryControl("Orphaned", key, "Orphan", _logger, None)
record.stop = True
record.entries = answer[record.uuid]
IN_COMM_Q.put(record)