mirror of
https://github.com/MrSleeps/jellyfin-scene-search.git
synced 2026-11-19 00:03:36 +00:00
Preserve frame order when mixing saved and new routes
This commit is contained in:
+11
-2
@@ -393,7 +393,10 @@ def _route_rows(
|
||||
if override is not None:
|
||||
decisions[str(row["id"])] = override
|
||||
|
||||
routed: list[tuple] = list(reusable)
|
||||
routed_by_id = {
|
||||
str(row["id"]): (row, route, score, reason)
|
||||
for row, route, score, reason in reusable
|
||||
}
|
||||
with connect(settings.db_path) as con:
|
||||
for row in valid_rows:
|
||||
frame_id = str(row["id"])
|
||||
@@ -408,13 +411,19 @@ def _route_rows(
|
||||
""",
|
||||
(route, reason, score, route_model, policy, frame_id),
|
||||
)
|
||||
routed.append((row, route, score, reason))
|
||||
routed_by_id[frame_id] = (row, route, score, reason)
|
||||
if verbose:
|
||||
print(
|
||||
f"{row['title']} @ {format_ts(int(row['timestamp_ms']))}: "
|
||||
f"score={score:.4f} -> {route} ({reason})"
|
||||
)
|
||||
|
||||
routed = [
|
||||
routed_by_id[str(row["id"])]
|
||||
for row in rows
|
||||
if str(row["id"]) in routed_by_id
|
||||
]
|
||||
|
||||
if progress is not None:
|
||||
progress(
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user