mirror of
https://github.com/beetbox/beets.git
synced 2025-12-14 20:43:41 +01:00
Duplicate album-import summary shows old/new filesize
E.g.: Old: 13 items, MP3, 256kbps, 44:32, 101MB New: 13 items, MP3, 320kbps, 44:31, 128MB Fix #1291
This commit is contained in:
parent
336bb9255c
commit
43e9044843
2 changed files with 7 additions and 0 deletions
|
|
@ -595,6 +595,11 @@ class Item(LibModel):
|
|||
"""
|
||||
return int(os.path.getmtime(syspath(self.path)))
|
||||
|
||||
def filesize(self):
|
||||
"""Returns the size, in bytes, of the file.
|
||||
"""
|
||||
return os.path.getsize(syspath(self.path))
|
||||
|
||||
# Model methods.
|
||||
|
||||
def remove(self, delete=False, with_album=True):
|
||||
|
|
|
|||
|
|
@ -439,8 +439,10 @@ def summarize_items(items, singleton):
|
|||
|
||||
average_bitrate = sum([item.bitrate for item in items]) / len(items)
|
||||
total_duration = sum([item.length for item in items])
|
||||
total_filesize = sum([item.filesize() for item in items])
|
||||
summary_parts.append('{0}kbps'.format(int(average_bitrate / 1000)))
|
||||
summary_parts.append(ui.human_seconds_short(total_duration))
|
||||
summary_parts.append(ui.human_bytes(total_filesize))
|
||||
|
||||
return ', '.join(summary_parts)
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue