mirror of
https://github.com/beetbox/beets.git
synced 2025-12-15 13:07:09 +01:00
More refactoring for convert
This commit is contained in:
parent
6eb497b21b
commit
6402b664c6
2 changed files with 5 additions and 5 deletions
|
|
@ -441,8 +441,9 @@ class Item(LibModel):
|
|||
raise WriteError(self.path, exc)
|
||||
|
||||
# The file has a new mtime.
|
||||
self.mtime = self.current_mtime()
|
||||
plugins.send('after_write', item=self)
|
||||
if path == self.path:
|
||||
self.mtime = self.current_mtime()
|
||||
plugins.send('after_write', item=self, path=path)
|
||||
|
||||
|
||||
# Files themselves.
|
||||
|
|
|
|||
|
|
@ -176,15 +176,13 @@ def convert_item(dest_dir, keep_new, path_formats):
|
|||
except subprocess.CalledProcessError:
|
||||
continue
|
||||
|
||||
if keep_new:
|
||||
item.path = converted
|
||||
|
||||
# Write tags from the database to the converted file.
|
||||
item.write(path=converted)
|
||||
|
||||
if keep_new:
|
||||
# If we're keeping the transcoded file, read it again (after
|
||||
# writing) to get new bitrate, duration, etc.
|
||||
item.path = converted
|
||||
item.read()
|
||||
item.store() # Store new path and audio data.
|
||||
|
||||
|
|
@ -194,6 +192,7 @@ def convert_item(dest_dir, keep_new, path_formats):
|
|||
artpath = album.artpath
|
||||
if artpath:
|
||||
_embed(artpath, [item])
|
||||
|
||||
plugins.send('after_convert', item=item, dest=dest, keepnew=keep_new)
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue