FrontEnd angepasst
This commit is contained in:
parent
545996d501
commit
96674ccf62
4 changed files with 15 additions and 11 deletions
|
|
@ -30,9 +30,9 @@ class Convert:
|
|||
if len(self.active_tasks) >= self.yaml["task_max"]:
|
||||
break
|
||||
|
||||
if len(self.active_tasks) >= 0:
|
||||
if len(self.active_tasks) > 0:
|
||||
logging.info(f"{len(self.active_tasks)} is active.")
|
||||
await asyncio.sleep(600)
|
||||
await asyncio.sleep(500)
|
||||
continue
|
||||
|
||||
if self.obj_path.count_paths(None) == 0 and len(self.active_tasks) == 0:
|
||||
|
|
|
|||
|
|
@ -93,6 +93,8 @@ class Path:
|
|||
:param var_paths: String or List of a single or more Media Paths
|
||||
:return: True or False
|
||||
"""
|
||||
logging.info(f"Empfangen{var_paths}")
|
||||
|
||||
if isinstance(var_paths, str):
|
||||
pattern = r"(?<=\.mkv\s|\.mp4\s|\.avi\s)|(?<=\.webm\s)"
|
||||
paths = re.split(pattern, var_paths)
|
||||
|
|
|
|||
|
|
@ -30,11 +30,14 @@ class Server:
|
|||
async def start_convert(self):
|
||||
global var_convert_active
|
||||
|
||||
if var_convert_active == False and self.yaml['autostart']:
|
||||
try:
|
||||
if not var_convert_active and self.yaml['autostart']:
|
||||
await self.obj_convert.snake_waiting()
|
||||
var_convert_active = True
|
||||
else:
|
||||
self.obj_convert.snake_update()
|
||||
finally:
|
||||
self.set_var_convert_active(False)
|
||||
|
||||
async def send_websocket(self, message):
|
||||
message_json = json.dumps(message)
|
||||
|
|
@ -87,9 +90,8 @@ class Server:
|
|||
var_convert_active = value
|
||||
|
||||
async def server_websocket(self):
|
||||
# Bei Server Start einmal ausführen
|
||||
self.obj_path.read_paths()
|
||||
await self.start_convert()
|
||||
asyncio.create_task(self.start_convert())
|
||||
|
||||
server = await websockets.serve(self.handle_client, self.yaml['server_ip'], self.yaml['websocket_port'])
|
||||
logging.info(f"Websocket Server läuft auf IP: {self.yaml['server_ip']} Port: {self.yaml['websocket_port']}")
|
||||
|
|
|
|||
|
|
@ -125,7 +125,7 @@ function createVideoElement(packet){
|
|||
}
|
||||
|
||||
function deepEqual(dict1, dict2) {
|
||||
return JSON.stringify(dict2) === JSON.stringify(dict2);
|
||||
return JSON.stringify(dict1) === JSON.stringify(dict2);
|
||||
}
|
||||
|
||||
function createWaitingSnake(packet){
|
||||
|
|
@ -134,7 +134,7 @@ function createWaitingSnake(packet){
|
|||
Object.keys(packet.data_queue).forEach(key => {
|
||||
const video = packet.data_queue[key];
|
||||
|
||||
if(!deepEqual(videoActive[key], video)){
|
||||
if(videoActive[key] && videoActive[key].status !== video.status){
|
||||
const elem = document.getElementById(key);
|
||||
if(elem){
|
||||
elem.remove();
|
||||
|
|
|
|||
Loading…
Reference in a new issue