'Return the total number of tracks on all discs on the album'

def _albumtotal(self):

    if ((self.disctotal == 1) or (not beets.config['per_disc_numbering'])):
        return self.items()[0].tracktotal
    counted = []
    total = 0
    for item in self.items():
        if (item.disc in counted):
            continue
        total += item.tracktotal
        counted.append(item.disc)
        if (len(counted) == self.disctotal):
            break
    return total
