nedo-vision-worker 1.2.5__py3-none-any.whl → 1.2.6__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- nedo_vision_worker/__init__.py +1 -1
- nedo_vision_worker/services/WorkerSourceUpdater.py +27 -8
- {nedo_vision_worker-1.2.5.dist-info → nedo_vision_worker-1.2.6.dist-info}/METADATA +1 -1
- {nedo_vision_worker-1.2.5.dist-info → nedo_vision_worker-1.2.6.dist-info}/RECORD +7 -7
- {nedo_vision_worker-1.2.5.dist-info → nedo_vision_worker-1.2.6.dist-info}/WHEEL +0 -0
- {nedo_vision_worker-1.2.5.dist-info → nedo_vision_worker-1.2.6.dist-info}/entry_points.txt +0 -0
- {nedo_vision_worker-1.2.5.dist-info → nedo_vision_worker-1.2.6.dist-info}/top_level.txt +0 -0
nedo_vision_worker/__init__.py
CHANGED
|
@@ -36,12 +36,25 @@ class WorkerSourceUpdater:
|
|
|
36
36
|
url = source.file_path
|
|
37
37
|
|
|
38
38
|
if not url:
|
|
39
|
+
logger.debug(f"[WorkerSource {source.id}] No URL available for metadata probe")
|
|
39
40
|
return None
|
|
40
41
|
|
|
41
42
|
if source.type_code == "file":
|
|
42
43
|
url = self.source_file_path / os.path.basename(url)
|
|
43
44
|
|
|
44
|
-
|
|
45
|
+
try:
|
|
46
|
+
metadata = VideoProbeUtil.get_video_metadata(url)
|
|
47
|
+
if metadata:
|
|
48
|
+
logger.debug(
|
|
49
|
+
f"[WorkerSource {source.id}] Metadata retrieved: "
|
|
50
|
+
f"resolution={metadata.get('resolution')}, frame_rate={metadata.get('frame_rate')}"
|
|
51
|
+
)
|
|
52
|
+
else:
|
|
53
|
+
logger.warning(f"[WorkerSource {source.id}] Metadata probe returned None for URL: {url}")
|
|
54
|
+
return metadata
|
|
55
|
+
except Exception as e:
|
|
56
|
+
logger.error(f"[WorkerSource {source.id}] Error getting metadata: {e}")
|
|
57
|
+
return None
|
|
45
58
|
|
|
46
59
|
def update_worker_sources(self):
|
|
47
60
|
"""Fetch local worker sources, probe video URLs, and update if different from the local DB.
|
|
@@ -57,26 +70,25 @@ class WorkerSourceUpdater:
|
|
|
57
70
|
metadata = self._get_source_metadata(source)
|
|
58
71
|
if not metadata:
|
|
59
72
|
logger.warning(f"⚠️ [APP] Failed to probe video for Worker Source ID {source.id} (type: {source.type_code}, url: {source.url if hasattr(source, 'url') else 'N/A'})")
|
|
60
|
-
#
|
|
61
|
-
if source.status_code
|
|
73
|
+
# Only set disconnected if currently connected (avoid flip-flopping)
|
|
74
|
+
if source.status_code == "connected":
|
|
62
75
|
source.status_code = "disconnected"
|
|
63
|
-
source.resolution = None
|
|
64
|
-
source.frame_rate = None
|
|
65
76
|
updated_records.append(source)
|
|
66
77
|
|
|
67
78
|
# Send gRPC update for disconnected status
|
|
79
|
+
# Keep existing resolution and frame_rate - don't overwrite with None
|
|
68
80
|
worker_timestamp = datetime.now(timezone.utc).strftime("%Y-%m-%dT%H:%M:%S.%f")[:-3] + "Z"
|
|
69
81
|
response = self.client.update_worker_source(
|
|
70
82
|
worker_source_id=source.id,
|
|
71
|
-
resolution=
|
|
83
|
+
resolution=source.resolution,
|
|
72
84
|
status_code="disconnected",
|
|
73
|
-
frame_rate=
|
|
85
|
+
frame_rate=source.frame_rate,
|
|
74
86
|
worker_timestamp=worker_timestamp,
|
|
75
87
|
token=self.token,
|
|
76
88
|
)
|
|
77
89
|
|
|
78
90
|
if response.get("success"):
|
|
79
|
-
logger.info(f"✅ [APP] Updated Worker Source ID {source.id} to disconnected")
|
|
91
|
+
logger.info(f"✅ [APP] Updated Worker Source ID {source.id} to disconnected (kept existing resolution/framerate)")
|
|
80
92
|
else:
|
|
81
93
|
logger.error(f"🚨 [APP] Failed to update Worker Source ID {source.id} to disconnected: {response.get('message')}")
|
|
82
94
|
continue
|
|
@@ -85,6 +97,13 @@ class WorkerSourceUpdater:
|
|
|
85
97
|
resolution = metadata.get("resolution")
|
|
86
98
|
frame_rate = int(round(metadata.get("frame_rate"), 0)) if metadata.get("frame_rate") else None
|
|
87
99
|
status_code = "connected" if resolution else "disconnected"
|
|
100
|
+
|
|
101
|
+
if resolution is None and source.resolution is not None:
|
|
102
|
+
resolution = source.resolution
|
|
103
|
+
|
|
104
|
+
if frame_rate is None and source.frame_rate is not None:
|
|
105
|
+
frame_rate = source.frame_rate
|
|
106
|
+
|
|
88
107
|
# .NET Compatible time
|
|
89
108
|
worker_timestamp = datetime.now(timezone.utc).strftime("%Y-%m-%dT%H:%M:%S.%f")[:-3] + "Z"
|
|
90
109
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: nedo-vision-worker
|
|
3
|
-
Version: 1.2.
|
|
3
|
+
Version: 1.2.6
|
|
4
4
|
Summary: Nedo Vision Worker Service Library for AI Vision Processing
|
|
5
5
|
Author-email: Willy Achmat Fauzi <willy.achmat@gmail.com>
|
|
6
6
|
Maintainer-email: Willy Achmat Fauzi <willy.achmat@gmail.com>
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
nedo_vision_worker/__init__.py,sha256=
|
|
1
|
+
nedo_vision_worker/__init__.py,sha256=3uSTVntcW747CFtMZ_qyKrptoNgHDvLNjg0pdgb4otM,203
|
|
2
2
|
nedo_vision_worker/cli.py,sha256=ddWspJmSgVkcUYvRdkvTtMNuMTDvNCqLLuMVU9KE3Ik,7457
|
|
3
3
|
nedo_vision_worker/doctor.py,sha256=wNkpe8gLVd76Y_ViyK2h1ZFdqeSl37MnzZN5frWKu30,48410
|
|
4
4
|
nedo_vision_worker/worker_service.py,sha256=rXUVmyxcJPGhQEZ4UQvjQS5UqlnLBYudHQZCj0dQDxo,10421
|
|
@@ -66,7 +66,7 @@ nedo_vision_worker/services/VideoSharingDaemon.py,sha256=hYMjUIKNUVT1qSxuUuHN-7B
|
|
|
66
66
|
nedo_vision_worker/services/VideoStreamClient.py,sha256=QSgUV3LijYrNdnBG1ylABOdUaSatQamfXaqJhAiol9M,7260
|
|
67
67
|
nedo_vision_worker/services/WorkerSourceClient.py,sha256=vDZeCuHL5QQ2-knZ4TOSA59jzmbbThGIwFKKLEZ72Ws,9198
|
|
68
68
|
nedo_vision_worker/services/WorkerSourcePipelineClient.py,sha256=qaBx9T2gWMzpqZaeQdbIeklsXNwzWD5kqgB41rrSkBI,17135
|
|
69
|
-
nedo_vision_worker/services/WorkerSourceUpdater.py,sha256=
|
|
69
|
+
nedo_vision_worker/services/WorkerSourceUpdater.py,sha256=4t_CEHBLGDRvvuQS6eEPMivTI11ZuzusKKto6t9tPIk,9115
|
|
70
70
|
nedo_vision_worker/services/WorkerStatusClient.py,sha256=7kC5EZjEBwWtHOE6UQ29OPCpYnv_6HSuH7Tc0alK_2Q,2531
|
|
71
71
|
nedo_vision_worker/services/__init__.py,sha256=Nqnn8clbgv-5l0PgxcTOldg8mkMKrFn4TvPL-rYUUGg,1
|
|
72
72
|
nedo_vision_worker/util/FFmpegUtil.py,sha256=QnQrzurmllzGb7SlAAYCrzKBUblweoFU-0h-X-32IYg,1829
|
|
@@ -91,8 +91,8 @@ nedo_vision_worker/worker/SystemUsageManager.py,sha256=StutV4UyLUfduYfK20de4SbPd
|
|
|
91
91
|
nedo_vision_worker/worker/VideoStreamWorker.py,sha256=5n6v1PNO7IB-jj_McALLkUP-cBjJoIEw4UiSAs3vTb0,7606
|
|
92
92
|
nedo_vision_worker/worker/WorkerManager.py,sha256=T0vMfhOd7YesgQ9o2w6soeJ6n9chUAcuwcGe7p31xr0,5298
|
|
93
93
|
nedo_vision_worker/worker/__init__.py,sha256=Nqnn8clbgv-5l0PgxcTOldg8mkMKrFn4TvPL-rYUUGg,1
|
|
94
|
-
nedo_vision_worker-1.2.
|
|
95
|
-
nedo_vision_worker-1.2.
|
|
96
|
-
nedo_vision_worker-1.2.
|
|
97
|
-
nedo_vision_worker-1.2.
|
|
98
|
-
nedo_vision_worker-1.2.
|
|
94
|
+
nedo_vision_worker-1.2.6.dist-info/METADATA,sha256=irbHs4_-uj182kff6PpW0YND59Q_UwhsPVLb5wI5NNQ,14661
|
|
95
|
+
nedo_vision_worker-1.2.6.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
96
|
+
nedo_vision_worker-1.2.6.dist-info/entry_points.txt,sha256=LrglS-8nCi8C_PL_pa6uxdgCe879hBETHDVXAckvs-8,60
|
|
97
|
+
nedo_vision_worker-1.2.6.dist-info/top_level.txt,sha256=vgilhlkyD34YsEKkaBabmhIpcKSvF3XpzD2By68L-XI,19
|
|
98
|
+
nedo_vision_worker-1.2.6.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|