Revert some of #4226

Rectify a couple of things in that PR, pointed out here:
https://github.com/beetbox/beets/pull/4226#issuecomment-1011499620

- Undo the `pretend` sensitivity in the import path, because it's not
  clear how this setting could ever be true.
- Preserve the log message in debug mode, even when quiet.
This commit is contained in:
Adrian Sampson 2022-01-29 18:31:48 -05:00
parent 19e4f41a72
commit 088cdfe995
No known key found for this signature in database
GPG key ID: BDB93AB409CC8705

View file

@ -22,6 +22,7 @@ import subprocess
import tempfile
import shlex
from string import Template
import logging
from beets import ui, util, plugins, config
from beets.plugins import BeetsPlugin
@ -514,23 +515,21 @@ class ConvertPlugin(BeetsPlugin):
except subprocess.CalledProcessError:
return
pretend = self.config['pretend'].get(bool)
quiet = self.config['quiet'].get(bool)
# Change the newly-imported database entry to point to the
# converted file.
source_path = item.path
item.path = dest
item.write()
item.read() # Load new audio information data.
item.store()
if not pretend:
# Change the newly-imported database entry to point to the
# converted file.
source_path = item.path
item.path = dest
item.write()
item.read() # Load new audio information data.
item.store()
if self.config['delete_originals']:
if not quiet:
self._log.info('Removing original file {0}',
source_path)
util.remove(source_path, False)
if self.config['delete_originals']:
self._log.log(
logging.DEBUG if self.config['quiet'] else logging.INFO,
'Removing original file {0}',
source_path,
)
util.remove(source_path, False)
def _cleanup(self, task, session):
for path in task.old_paths: