File tree 1 file changed +3
-12
lines changed
1 file changed +3
-12
lines changed Original file line number Diff line number Diff line change @@ -35,10 +35,7 @@ def announce():
35
35
if ip in app .config ["BANLIST" ]:
36
36
return "Banned." , 403
37
37
38
- if request .method == "POST" :
39
- data = request .form ["json" ]
40
- else :
41
- data = request .args ["json" ]
38
+ data = request .form ["json" ] if request .method == "POST" else request .args ["json" ]
42
39
43
40
if len (data ) > 5000 :
44
41
return "JSON data is too big." , 413
@@ -90,18 +87,12 @@ def announce():
90
87
91
88
server ["update_time" ] = time .time ()
92
89
93
- if server ["action" ] == "start" :
94
- server ["start" ] = time .time ()
95
- else :
96
- server ["start" ] = old ["start" ]
90
+ server ["start" ] = time .time () if server ["action" ] == "start" else old ["start" ]
97
91
98
92
if "clients_list" in server :
99
93
server ["clients" ] = len (server ["clients_list" ])
100
94
101
- if old :
102
- server ["clients_top" ] = max (server ["clients" ], old ["clients_top" ])
103
- else :
104
- server ["clients_top" ] = server ["clients" ]
95
+ server ["clients_top" ] = max (server ["clients" ], old ["clients_top" ]) if old else server ["clients" ]
105
96
106
97
# Make sure that startup options are saved
107
98
if server ["action" ] != "start" :
You can’t perform that action at this time.
0 commit comments