mirror of
https://github.com/beetbox/beets.git
synced 2026-01-18 06:05:06 +01:00
missing: tolerate disctotal == None
This problem: http://pastebin.ca/2466454 is likely indicative of a bug elsewhere, but defensive coding seems like a good idea here.
This commit is contained in:
parent
ce7254c08a
commit
fac13a041e
2 changed files with 5 additions and 1 deletions
|
|
@ -28,7 +28,7 @@ log = logging.getLogger('beets')
|
|||
def _missing_count(album):
|
||||
"""Return number of missing items in `album`.
|
||||
"""
|
||||
return album.tracktotal - len([i for i in album.items()])
|
||||
return (album.tracktotal or 0) - len(album.items())
|
||||
|
||||
|
||||
def _missing(album):
|
||||
|
|
|
|||
|
|
@ -4,6 +4,10 @@ Changelog
|
|||
1.3.2 (in development)
|
||||
----------------------
|
||||
|
||||
Little fixes:
|
||||
|
||||
* :doc:`/plugins/missing`: Avoid a possible error when an album's
|
||||
``tracktotal`` field is missing.
|
||||
|
||||
1.3.1 (October 12, 2013)
|
||||
------------------------
|
||||
|
|
|
|||
Loading…
Reference in a new issue