def ipfs_add(self, album):
        try:
            album_dir = album.item_dir()
        except AttributeError:
            return False
        try:
            if album.ipfs:
                self._log.debug('{0} already added', album_dir)
                # Already added to ipfs
                return False
        except AttributeError:
            pass

        self._log.info('Adding {0} to ipfs', album_dir)

        cmd = "ipfs add -q -r".split()
        cmd.append(album_dir)
        try:
            output = util.command_output(cmd).split()
        except (OSError, subprocess.CalledProcessError) as exc:
            self._log.error(u'Failed to add {0}, error: {1}', album_dir, exc)
            return False
        length = len(output)

        for linenr, line in enumerate(output):
            line = line.strip()
            if linenr == 1 - length:
                # last printed line is the album hash
                self._log.info("album: {0}", line)
                album.ipfs = line
            else:
                try:
                    item = album.items()[linenr]
                    self._log.info("item: {0}", line)
                    item.ipfs = line
                    item.store()
                except IndexError:
                    # if there's non music files in the to-add folder they'll
                    # get ignored here
                    pass

        return True
dataset/ETHPy150Open beetbox/beets/beetsplug/ipfs.py/IPFSPlugin.ipfs_add/swapped operands of `-`