zabgrab.services.update¶
Continuing a file’s fetches from where they left off (zabgrab update).
An update repeats the file’s last fetch from where it ended, with the same items and settings, using the metadata stored with it.
Functions
|
Look up the items fetched before, by ID, to download them again. |
|
Work out an update from the last group's metadata. |
Classes
|
What an update will fetch. |
- class zabgrab.services.update.UpdatePlan(query, last_group, servers=<factory>, items=<factory>, labels=<factory>)[source]¶
Bases:
objectWhat an update will fetch.
- Parameters:
- items¶
Item IDs fetched before, with their request labels, by server URL.
- zabgrab.services.update.plan_update(groups, *, config, ui, now, end, end_text, server, file_format)[source]¶
Work out an update from the last group’s metadata.
- Parameters:
groups (sequence of Group) – The file’s groups, in order.
config (Config) – The config, to find the servers by name (and the
jobsand other defaults).ui (UI) – Warns about servers no longer in the config.
now (datetime) – The current time.
end (datetime or None) – The end of the update (
--to), elsenow.end_text (str or None) –
--toas given.server (Server or None) – A server to use instead of the stored one (
--server).file_format (Format) – The file’s format.
- Returns:
UpdatePlan or None – The plan, or
Noneif there’s nothing to fetch (the file is up to date).- Raises:
ZabgrabError – If there are no groups, or the last one lacks the metadata needed.
- Return type:
UpdatePlan | None
- async zabgrab.services.update.collect_previous_items(plan, ui, *, connect)[source]¶
Look up the items fetched before, by ID, to download them again.
- Parameters:
plan (UpdatePlan) – The update.
ui (UI) – Warns about items that no longer exist.
connect (callable) – Returns a logged-in client for a server.
- Returns:
Plan – The download jobs, with the servers’ connections (close it when done).
- Return type: