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

Draft: importer: Add ability to verify copy and move operations #5217

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

oliv3r
Copy link

@oliv3r oliv3r commented May 3, 2024

Description

To avoid corrupting files and worse, remove the original files (move), a quick check is added to ensure files are still in order.

On failure the crc is printed to aid in discovering if the problem was with the source (unlikely) or destination file. Using filecmp would only tell us of a miss-match, but making it harder to figure out why/where things fail.

Since beets import can be destructive (move), we want to be delicate here.

To Do

  • Documentation. (If you've added a new command-line flag, for example, find the appropriate page under docs/ to describe it.)
  • Changelog. (Add an entry to docs/changelog.rst to the bottom of one of the lists near the top of the document.)
  • Tests. (Very much encouraged but not strictly required.)

@oliv3r
Copy link
Author

oliv3r commented May 3, 2024

Trying to figure out how to write a test for this; so any help would be greatly appreciated :)

But also being thrown about with NameError: name 'import_cmd_parser' is not defined both when running tox -e int but also just trying to run the application ...

@wisp3rwind
Copy link
Member

But also being thrown about with NameError: name 'import_cmd_parser' is not defined both when running tox -e int but also just trying to run the application ...

It's a typo: import_cmd.parser vs. import_cmd_parser.

@oliv3r
Copy link
Author

oliv3r commented May 4, 2024 via email

@wisp3rwind
Copy link
Member

I taken it it's fixed on master so I van just rebase? :)

No, you made a typo when adding the new verify command, which is why the tests fail.

To avoid corrupting files and worse, remove the original files (move), a
quick check is added to ensure files are still in order.

On failure the crc is printed to aid in discovering if the problem was
with the source (unlikely) or destination file. Using `filecmp` would only
tell us of a miss-match, but making it harder to figure out why/where
things fail.

Since `beets import` can be destructive (move), we want to be delicate
here.

Signed-off-by: Olliver Schinagl <oliver@schinagl.nl>
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.

None yet

2 participants