MCPcopy
hub / github.com/alexta69/metube / _download_info_from_record

Function _download_info_from_record

app/ytdl.py:388–405  ·  view source on GitHub ↗
(record: dict[str, Any])

Source from the content-addressed store, hash-verified

386
387
388def _download_info_from_record(record: dict[str, Any]) -> DownloadInfo:
389 info = DownloadInfo.__new__(DownloadInfo)
390 info.__setstate__({key: from_json_compatible(value) for key, value in record.items()})
391 if not hasattr(info, "msg"):
392 info.msg = None
393 if not hasattr(info, "percent"):
394 info.percent = None
395 if not hasattr(info, "speed"):
396 info.speed = None
397 if not hasattr(info, "eta"):
398 info.eta = None
399 if not hasattr(info, "status"):
400 info.status = "pending"
401 if not hasattr(info, "size"):
402 info.size = None
403 if not hasattr(info, "error"):
404 info.error = None
405 return info
406
407class Download:
408 manager = None

Callers 2

saved_itemsMethod · 0.85
_load_state_itemsMethod · 0.85

Calls 3

from_json_compatibleFunction · 0.90
__setstate__Method · 0.80
itemsMethod · 0.80

Tested by

no test coverage detected