c3bd009442
Recording a subtitle is idempotent on both keys the schema carries: the sidecar path, and the language an embedded track satisfies, so a second probe or a re-import converges instead of duplicating. Attempts are upserted per (media file, language); the work list is every language that is not satisfied, newest import first, which is the order §15 wants the daily allowance spent in.
87 lines
2.1 KiB
JSON
87 lines
2.1 KiB
JSON
{
|
|
"db_name": "SQLite",
|
|
"query": "SELECT media_file_id AS \"media_file_id!: i64\",\n language AS \"language!: String\",\n state AS \"state!: SubtitleState\",\n attempts AS \"attempts!: i64\",\n last_attempt_at,\n last_failure\n FROM subtitle_attempts\n WHERE media_file_id = ?\n ORDER BY language",
|
|
"describe": {
|
|
"columns": [
|
|
{
|
|
"name": "media_file_id!: i64",
|
|
"ordinal": 0,
|
|
"type_info": "Integer",
|
|
"origin": {
|
|
"Table": {
|
|
"table": "subtitle_attempts",
|
|
"name": "media_file_id"
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"name": "language!: String",
|
|
"ordinal": 1,
|
|
"type_info": "Text",
|
|
"origin": {
|
|
"Table": {
|
|
"table": "subtitle_attempts",
|
|
"name": "language"
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"name": "state!: SubtitleState",
|
|
"ordinal": 2,
|
|
"type_info": "Text",
|
|
"origin": {
|
|
"Table": {
|
|
"table": "subtitle_attempts",
|
|
"name": "state"
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"name": "attempts!: i64",
|
|
"ordinal": 3,
|
|
"type_info": "Integer",
|
|
"origin": {
|
|
"Table": {
|
|
"table": "subtitle_attempts",
|
|
"name": "attempts"
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"name": "last_attempt_at",
|
|
"ordinal": 4,
|
|
"type_info": "Text",
|
|
"origin": {
|
|
"Table": {
|
|
"table": "subtitle_attempts",
|
|
"name": "last_attempt_at"
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"name": "last_failure",
|
|
"ordinal": 5,
|
|
"type_info": "Text",
|
|
"origin": {
|
|
"Table": {
|
|
"table": "subtitle_attempts",
|
|
"name": "last_failure"
|
|
}
|
|
}
|
|
}
|
|
],
|
|
"parameters": {
|
|
"Right": 1
|
|
},
|
|
"nullable": [
|
|
false,
|
|
false,
|
|
false,
|
|
false,
|
|
true,
|
|
true
|
|
]
|
|
},
|
|
"hash": "adf45101bc3ba20d35b59794053029e89d22ada5c7ffecd47187ec34261bc223"
|
|
}
|