Update beets/importer/tasks.py

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This commit is contained in:
gaotue 2026-03-23 14:46:08 +01:00 committed by GitHub
parent 54f438f176
commit 93b4eccc39
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1170,20 +1170,20 @@ class ImportTaskFactory:
"8svx",
"cda",
]
format = ""
detected_format = ""
# The first format from ffprobe that is on this list is taken
for f in formats:
if f in wiki_formats:
format = f
detected_format = f
break
# if ffprobe can't find a format, the file is prob not music
if format == "":
if detected_format == "":
return path
# cp and add ext. If already exist, use that file
# assume, for example, the only diff between 'asdf.mp3' and 'asdf' is format
new_path = path.with_suffix("." + format)
new_path = path.with_suffix("." + detected_format)
if not new_path.exists():
util.move(path, new_path)
else: