no multi td search for tg files and fix

This commit is contained in:
anas 2021-09-17 11:55:11 +03:00
parent 34998be5a2
commit 350a31967f
2 changed files with 6 additions and 4 deletions

View File

@ -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

View File

@ -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'<h4>Search Result For: {fileName}</h4><br><br>'
@ -761,7 +763,7 @@ class GoogleDriveHelper:
self.telegraph_content.append(msg)
msg = ""
content_count = 0
if clone:
if noMulti:
break
if msg != '':