'Remove a download by it\'s infohash.
We can only remove content when the download object is found, otherwise only
the state is removed.
:param infohash: the download to remove
:param remove_content: whether to delete the already downloaded content from disk
:param remove_state: whether to remove the metadata files from disk'

def remove_download_by_id(self, infohash, remove_content=False, remove_state=True):

    download_list = self.get_downloads()
    for download in download_list:
        if (download.get_def().get_infohash() == infohash):
            self.remove_download(download, remove_content, remove_state)
            return
    self.lm.remove_id(infohash)
