Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🐛 Fix logical error preventing force rebuild scans #574

Merged
merged 2 commits into from
Jan 29, 2025

Conversation

aaronleopold
Copy link
Collaborator

@aaronleopold aaronleopold commented Jan 29, 2025

Fixes a small logical error that prevented the scan options from being considered when a modified timestamp could be extracted from a file on disk. This allows for the scan options to be considered but, as I mentioned on Discord, options will force a full rebuild of every book and corresponding metadata for the library. This is why I didn't expose it on the UI yet, that will be properly implemented by https://github.com/stumpapp/stump/tree/al/granular-scans.

I verified this fix by creating a library without koreader hashes enabled, enabling it, then running a scan with force_rebuild:

❯ curl http://localhost:10801/api/v1/media/7c760277-8b17-4c67-b2a8-72fe4c7008fb \
        -H "Authorization: Bearer stump_S36i9cffbt7_3y9uG3KDHfoVHnuk4JorjUL9FuWpbjRsi" | jq '{koreader_hash}'
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   753  100   753    0     0  29780      0 --:--:-- --:--:-- --:--:-- 30120
{
  "koreader_hash": null
}

❯ curl -X POST http://localhost:10801/api/v1/libraries/2e16160f-eb38-467d-96ce-2b039e73e8a9/scan \
        -H "Authorization: Bearer stump_S36i9cffbt7_3y9uG3KDHfoVHnuk4JorjUL9FuWpbjRsi" \
        -H "Content-Type: application/json" \
        -d '{"force_rebuild": true}'

❯ curl http://localhost:10801/api/v1/media/7c760277-8b17-4c67-b2a8-72fe4c7008fb \
        -H "Authorization: Bearer stump_S36i9cffbt7_3y9uG3KDHfoVHnuk4JorjUL9FuWpbjRsi" | jq '{koreader_hash}'
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   783  100   783    0     0  47043      0 --:--:-- --:--:-- --:--:-- 48937
{
  "koreader_hash": "803d9ee1501e9bc060fc1068d78008cc"
}

API keys are from my local development instance so it doesn't matter

Copy link

codecov bot commented Jan 29, 2025

Codecov Report

Attention: Patch coverage is 0% with 4 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
core/src/filesystem/scanner/walk.rs 0.00% 4 Missing ⚠️
Files with missing lines Coverage Δ
core/src/filesystem/scanner/walk.rs 0.00% <0.00%> (ø)

@aaronleopold aaronleopold marked this pull request as ready for review January 29, 2025 20:06
@aaronleopold aaronleopold merged commit 28cff9d into develop Jan 29, 2025
9 checks passed
@aaronleopold aaronleopold deleted the al/patch-force-rebuild-bug branch January 29, 2025 23:45
@aaronleopold aaronleopold mentioned this pull request Feb 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant