'iTunes does not delete books from storage when removing from database via automation'

def _remove_from_iTunes(self, cached_book):

    if self.verbose:
        logger().info(('    %s._remove_from_iTunes():' % self.__class__.__name__))
    if isosx:
        '    Manually    remove    the    book    from    iTunes    storage    '
        try:
            fp = cached_book['lib_book'].location().path
            if self.verbose:
                logger().info(('        processing    %s' % fp))
            if fp.startswith(prefs['library_path']):
                logger().info(("        '%s'    stored    in    calibre    database,    not    removed" % cached_book['title']))
            elif ((not self.settings().extra_customization[self.USE_ITUNES_STORAGE]) and fp.startswith(self.iTunes_local_storage) and os.path.exists(fp)):
                os.remove(fp)
                if self.verbose:
                    logger()('            removing    from    iTunes_local_storage')
            elif os.path.exists(fp):
                os.remove(fp)
                if self.verbose:
                    logger().info('            deleting    from    iTunes    storage')
                author_storage_path = os.path.split(fp)[0]
                try:
                    os.rmdir(author_storage_path)
                    if self.verbose:
                        logger().info('            removing    empty    author    directory')
                except:
                    author_files = os.listdir(author_storage_path)
                    if ('.DS_Store' in author_files):
                        author_files.pop(author_files.index('.DS_Store'))
                    if (not author_files):
                        os.rmdir(author_storage_path)
                        if self.verbose:
                            logger().info('            removing    empty    author    directory')
            else:
                logger().info(("            '%s'    does    not    exist    at    storage    location" % cached_book['title']))
        except:
            if self.verbose:
                logger().info(("            '%s'    by    %s    not    found    in    iTunes    storage" % (cached_book['title'], cached_book['author'])))
        try:
            self.iTunes.delete(cached_book['lib_book'])
            if self.verbose:
                logger().info('            removing    from    iTunes    database')
        except:
            if self.verbose:
                logger().info('            unable    to    remove    from    iTunes    database')
    elif iswindows:
        "\n                                                Assume    we're    wrapped    in    a    pythoncom\n                                                Windows    stores    the    book    under    a    common    author    directory,    so    we    just    delete    the    .epub\n                                                "
        fp = None
        try:
            book = cached_book['lib_book']
            fp = book.Location
        except:
            book = self._find_library_book(cached_book)
            if book:
                fp = book.Location
        if book:
            if self.verbose:
                logger().info(('        processing    %s' % fp))
            if fp.startswith(prefs['library_path']):
                logger().info(("        '%s'    stored    in    calibre    database,    not    removed" % cached_book['title']))
            elif ((not self.settings().extra_customization[self.USE_ITUNES_STORAGE]) and fp.startswith(self.iTunes_local_storage) and os.path.exists(fp)):
                os.remove(fp)
                if self.verbose:
                    logger()('            removing    from    iTunes_local_storage')
            elif os.path.exists(fp):
                os.remove(fp)
                if self.verbose:
                    logger().info('            deleting    from    iTunes    storage')
                author_storage_path = os.path.split(fp)[0]
                try:
                    os.rmdir(author_storage_path)
                    if self.verbose:
                        logger().info('            removing    empty    author    directory')
                except:
                    pass
            else:
                logger().info(("            '%s'    does    not    exist    at    storage    location" % cached_book['title']))
        elif self.verbose:
            logger().info(("            '%s'    not    found    in    iTunes    storage" % cached_book['title']))
        try:
            book.Delete()
            if self.verbose:
                logger().info('            removing    from    iTunes    database')
        except:
            if self.verbose:
                logger().info('            unable    to    remove    from    iTunes    database')
