|
|
@@ -51,6 +51,13 @@ def _today_dt() -> str:
|
|
|
return datetime.now(ZoneInfo("Asia/Shanghai")).strftime("%Y%m%d")
|
|
|
|
|
|
|
|
|
+def _is_allowed_level(level_value: Any) -> bool:
|
|
|
+ try:
|
|
|
+ return int(level_value) in (0, 1, 2)
|
|
|
+ except (TypeError, ValueError):
|
|
|
+ return False
|
|
|
+
|
|
|
+
|
|
|
def _is_decode_submit_open() -> bool:
|
|
|
"""
|
|
|
Gate for submitting NEW decode tasks.
|
|
|
@@ -277,7 +284,12 @@ def _pick_candidate_records(dt: str, batch_size: int = BATCH_SIZE) -> List[Dict[
|
|
|
break
|
|
|
for item in page:
|
|
|
vid = str(item.get("vid") or "")
|
|
|
- if not vid or vid in existing_vids or vid in selected_vids:
|
|
|
+ if (
|
|
|
+ not vid
|
|
|
+ or not _is_allowed_level(item.get("level"))
|
|
|
+ or vid in existing_vids
|
|
|
+ or vid in selected_vids
|
|
|
+ ):
|
|
|
continue
|
|
|
selected.append(item)
|
|
|
selected_vids.add(vid)
|