Fehler beseitigt

This commit is contained in:
Eduard Wisch 2025-04-28 21:13:16 +02:00
parent 8816751be6
commit 796efb20e7
5 changed files with 10 additions and 7 deletions

View file

@ -77,16 +77,15 @@ class Convert:
logging.error(f"Fehler in video_convert(): {e}")
finally:
logging.info(f"Prozess {result}({obj.process.returncode}): {obj.source_file_name}")
await self.obj_websocket.send_websocket(obj.to_dict())
await self.obj_websocket.send_websocket(self.obj_path.active_path_to_dict())
await self.obj_websocket.send_websocket(self.obj_path.queue_path_to_dict())
self.active_process.discard(obj)
self.active_tasks.discard(obj)
self.obj_path.save_paths()
obj.convert_end = time.time()
obj_stat.save_stat(obj)
obj.convert_end = time.time()
def convert_cmd(self, obj):
command_convert = [

View file

@ -34,7 +34,10 @@ class Process:
self.process_line_extract(obj, line_decoded)
#logging.info(line_decoded)
self.loading = (self.frames / obj.source_frames_total) * 100
if obj.source_frames_total > 0:
self.loading = (self.frames / obj.source_frames_total) * 100 > 0
else:
self.loading = 0
await self.obj_websocket.send_websocket(self.to_dict(obj))

View file

@ -119,7 +119,7 @@ class Path:
"stream=index,channels,codec_name,codec_type,pix_fmt,level,"
"film_grain,r_frame_rate,bit_rate,sample_rate,width,height,size,tags:stream_tags=language,duration",
"-show_entries",
"format=size,bit_rate,nb_streams",
"format=size,bit_rate,nb_streams,duration",
"-of", "json",
path
]

View file

@ -13,7 +13,7 @@ class Media:
self.source_file: str = path
self.source_path: str = os.path.dirname(path)
self.source_file_name: str = os.path.basename(self.source_file)
self.source_duration: int = self.time_in_sec(streams_video[0]["tags"].get("DURATION" or "duration", "00:00:00"))
self.source_duration: int = self.time_in_sec(streams_format[0].get("duration", "00:00:00"))
self.source_size: list = self.size_convert("B", None, "storage", int(streams_format[0].get("size")))
self.source_frame_rate: int = self.frame_rate(streams_video)
self.source_frames_total: int = self.source_frame_rate * self.source_duration

View file

@ -26,6 +26,7 @@ class Stat:
"""
daten = self.read_stat()
daten.setdefault("videos", {})
try:
# Neuen Eintrag hinzufügen
@ -36,7 +37,7 @@ class Stat:
except Exception as e:
logging.error(f"Save Stat Failure: {e}")
def read_stat(self) -> Dict[str, any]:
def read_stat(self) -> dict[str, any]:
"""
Read statistic from YAML file
:return: Dictionary width statistics