adsfolio.pdf.recheck_worker

Run one library’s automatic identifier recheck in a separate process.

The desktop app writes a JSON request file and starts the hidden adsfolio pdf recheck-worker REQUEST command. The worker writes a JSON result file next to the request and exits. A separate process keeps PDF parsing off the window’s Python interpreter, so scrolling stays smooth.

The app asks the worker to stop by creating the request’s cancel file. The worker checks for that file between steps, saves its progress, and exits.

adsfolio.pdf.recheck_worker.build_request(root, identify_settings, rename_settings, recursive, *, ads_enabled, retry_remembered, config_dir, cancel_path, result_path)[source]

Return a JSON-serializable request for one library recheck.

Parameters:
Return type:

dict[str, Any]

adsfolio.pdf.recheck_worker.has_external_providers(settings)[source]

Return whether the settings include a supported non-ADS provider.

Parameters:

settings (adsfolio.pdf.identify_settings.IdentifySettings)

Return type:

bool

adsfolio.pdf.recheck_worker.main(request_path)[source]

Run the request in this process and write its result file.

Returns:

0 when the result file exists. The result reports check failures.

Return type:

int

Parameters:

request_path (pathlib.Path)

adsfolio.pdf.recheck_worker.root_is_accessible(root)[source]

Return whether a library directory can be read and traversed.

Parameters:

root (pathlib.Path)

Return type:

bool

adsfolio.pdf.recheck_worker.run_request(request, cancelled)[source]

Run one recheck and return a JSON-serializable result payload.

Parameters:
Returns:

{"result": ..., "error": ...}. result is None when the check did not run, for example after an early cancel or without a usable provider.

Return type:

dict

adsfolio.pdf.recheck_worker.write_result(path, payload)[source]

Write a result file atomically, so the app never reads a partial file.

Parameters:
Return type:

None