summaryrefslogtreecommitdiff
path: root/fullnarp.py
diff options
context:
space:
mode:
authorerdgeist <erdgeist@erdgeist.org>2025-01-06 03:57:34 +0100
committererdgeist <erdgeist@erdgeist.org>2025-01-06 03:57:34 +0100
commit89f1f4006662f47186b32a38a5d85de5935512e5 (patch)
tree81e8367280295cb2d853712a0565791a165312a0 /fullnarp.py
parentd038549d9e01ce37f6decbbf51aa396fc7c57a96 (diff)
Formatted
Diffstat (limited to 'fullnarp.py')
-rw-r--r--fullnarp.py11
1 files changed, 9 insertions, 2 deletions
diff --git a/fullnarp.py b/fullnarp.py
index 0500d1b..1085732 100644
--- a/fullnarp.py
+++ b/fullnarp.py
@@ -49,6 +49,7 @@ SessionLocal = None
49Base = declarative_base() 49Base = declarative_base()
50fullnarp_path = "" 50fullnarp_path = ""
51 51
52
52class TalkPreference(Base): 53class TalkPreference(Base):
53 __tablename__ = "talk_preference" 54 __tablename__ = "talk_preference"
54 uid = Column(String, primary_key=True) 55 uid = Column(String, primary_key=True)
@@ -75,7 +76,10 @@ async def notify_clients():
75 message = { 76 message = {
76 "property": "fullnarp", 77 "property": "fullnarp",
77 "current_version": newest_version, 78 "current_version": newest_version,
78 "version_url": fullnarp_path + "versions/fullnarp_" + str(newest_version).zfill(5) + ".json", 79 "version_url": fullnarp_path
80 + "versions/fullnarp_"
81 + str(newest_version).zfill(5)
82 + ".json",
79 "data": current_version, 83 "data": current_version,
80 } 84 }
81 85
@@ -127,7 +131,10 @@ async def handle_client(websocket):
127 message = { 131 message = {
128 "property": "fullnarp", 132 "property": "fullnarp",
129 "current_version": newest_version, 133 "current_version": newest_version,
130 "version_url": fullnarp_path + "versions/fullnarp_" + str(newest_version).zfill(5) + ".json", 134 "version_url": fullnarp_path
135 + "versions/fullnarp_"
136 + str(newest_version).zfill(5)
137 + ".json",
131 "data": current_version, 138 "data": current_version,
132 } 139 }
133 await websocket.send(json.dumps(message)) 140 await websocket.send(json.dumps(message))