Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion beetsplug/check.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ def __init__(self):
"formats": "FLAC",
"error": "^.*: (?:WARNING|ERROR),? (.*)$",
# Recodes and fixes errors
"fix": 'flac -VFf --preserve-modtime -o "{0}" "${0}"',
"fix": "flac -VFf --preserve-modtime -o {0} {0}",
},
"oggz-validate": {"cmdline": "oggz-validate {0}", "formats": "OGG"},
},
Expand Down
16 changes: 16 additions & 0 deletions test/cli_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -311,6 +311,22 @@ def test_fix_integrity(self):
beets.ui._raw_main(["check", "-e"])
assert "WARNING It seems that file is truncated" not in "\n".join(logs)

def test_fix_flac_integrity(self):
item = self.addItemFixture("truncated.flac")

with pytest.raises(SystemExit), captureLog() as logs:
beets.ui._raw_main(["check", "-e"])
assert "WARNING" in "\n".join(logs)

with controlStdin("y"), captureLog() as logs:
beets.ui._raw_main(["check", "--fix"])
assert item.path.decode("utf-8") in "\n".join(logs)
assert "FIXED: {}".format(item.path.decode("utf-8")) in "\n".join(logs)

with captureLog() as logs:
beets.ui._raw_main(["check", "-e"])
assert "WARNING" not in "\n".join(logs)

def test_fix_without_confirmation(self):
item = self.addIntegrityFailFixture()

Expand Down
Binary file modified test/fixtures/truncated.flac
Binary file not shown.
Loading