diff --git a/beetsplug/missing.py b/beetsplug/missing.py index 0b12ebde6..fe2265da2 100644 --- a/beetsplug/missing.py +++ b/beetsplug/missing.py @@ -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): diff --git a/docs/changelog.rst b/docs/changelog.rst index e39c78c6c..b1819eeae 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -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) ------------------------