diff --git a/bot/helper/mirror_utils/download_utils/telegram_downloader.py b/bot/helper/mirror_utils/download_utils/telegram_downloader.py index 4d5584d..f4d330b 100644 --- a/bot/helper/mirror_utils/download_utils/telegram_downloader.py +++ b/bot/helper/mirror_utils/download_utils/telegram_downloader.py @@ -102,7 +102,7 @@ class TelegramDownloadHelper(DownloadHelper): if STOP_DUPLICATE: LOGGER.info('Checking File/Folder if already in Drive...') gd = GoogleDriveHelper() - smsg, button = gd.drive_list(name, True) + smsg, button = gd.drive_list(name, True, True) if smsg: sendMarkup("File/Folder is already available in Drive.\nHere are the search results:", self.__listener.bot, self.__listener.update, button) return diff --git a/bot/helper/mirror_utils/upload_utils/gdriveTools.py b/bot/helper/mirror_utils/upload_utils/gdriveTools.py index d6ea46e..9285237 100644 --- a/bot/helper/mirror_utils/upload_utils/gdriveTools.py +++ b/bot/helper/mirror_utils/upload_utils/gdriveTools.py @@ -684,7 +684,7 @@ class GoogleDriveHelper: ) - def drive_list(self, fileName, stopDup=False, clone=False): + def drive_list(self, fileName, stopDup=False, noMulti=False): self.stopDup = stopDup msg = "" if not stopDup: @@ -694,7 +694,9 @@ class GoogleDriveHelper: Title = False for index, parent_id in enumerate(DRIVES_IDS): response = self.drive_query(parent_id, fileName) - if not response["files"]: + if not response["files"] and noMulti: + break + elif not response["files"]: continue if not Title: msg += f'

Search Result For: {fileName}



' @@ -761,7 +763,7 @@ class GoogleDriveHelper: self.telegraph_content.append(msg) msg = "" content_count = 0 - if clone: + if noMulti: break if msg != '':