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

Tip for rescanning files with error #1426

Open
Snipees opened this issue Dec 30, 2024 · 0 comments
Open

Tip for rescanning files with error #1426

Snipees opened this issue Dec 30, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@Snipees
Copy link

Snipees commented Dec 30, 2024

The following is not an issue, but a tip that can be very useful if you want to rescan files in error, without having to delete the cache and rescan all files in your library.

The following procedure is for Windows, but can easily be adapted for Linux/MacOS.

A. Activate JSON cache

  1. Open the Czkawka interface, go to settings and check Also save cache as JSON file option, then click on Open cache folder button, which should take you to this similar directory:

C:\Users\YOURNAME\AppData\Local\Qarmin\Czkawka\cache

  1. Relaunch a scan of your library. At the end of the scan, a file cache_similar_videos_70.json in JSON format should appear.
  2. Optional: make a backup copy of the two cache files in this folder (bin and json)

B. Install JQ

  1. Right-click on start menu and select command shell as Administrator
  2. Install JQ by invoking this command: winget install jqlang.jq (wait for execution to finish)
  3. Close this command shell window and open new command shell (use current user, not admin)
  4. Check if JQ installed correctly by invoking this command: jq --version, must return a version number

C. Delete files with error from the cache

  1. Open a command prompt (with current user, not admin)
  2. Go to the cache folder: cd C:\Users\YOURNAME\AppData\Local\Qarmin\Czkawka\cache
  3. Execute the magic command:
  • for Windows:
    jq --raw-output "del(.[] | select(.error != \"\"))" cache_similar_videos_70.json > cache_similar_videos_70.new.json
  • for Linux/MacOS:
    jq --raw-output 'del(.[] | select(.error != ""))' cache_similar_videos_70.json > cache_similar_videos_70.new.json
  1. Delete the 2 old cache files (or move them elsewhere) and rename the generated file by removing .new
  2. Run a Czkawka scan, and you should notice that it re-scan the files you've just purged from cache

EnJoY ! 😎

D. Tip: format JSON for easy reading

From cache folder, run the following command:

  • for Windows:
    jq "." cache_similar_videos_70.json > cache_similar_videos_70.new.json
  • for Linux/MacOS:
    jq '.' cache_similar_videos_70.json > cache_similar_videos_70.new.json

to obtain a formatted (indented) JSON file for easy browsing in a notepad.

It would be great if such an option (rescanning/purging files with error) existed in this amazing application 😉

@Snipees Snipees added the enhancement New feature or request label Dec 30, 2024
@Snipees Snipees changed the title Tip for rescanning files in error Tip for rescanning files with error Dec 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant