no multi td search for tg files and fix
This commit is contained in:
parent
34998be5a2
commit
350a31967f
|
|
@ -102,7 +102,7 @@ class TelegramDownloadHelper(DownloadHelper):
|
||||||
if STOP_DUPLICATE:
|
if STOP_DUPLICATE:
|
||||||
LOGGER.info('Checking File/Folder if already in Drive...')
|
LOGGER.info('Checking File/Folder if already in Drive...')
|
||||||
gd = GoogleDriveHelper()
|
gd = GoogleDriveHelper()
|
||||||
smsg, button = gd.drive_list(name, True)
|
smsg, button = gd.drive_list(name, True, True)
|
||||||
if smsg:
|
if smsg:
|
||||||
sendMarkup("File/Folder is already available in Drive.\nHere are the search results:", self.__listener.bot, self.__listener.update, button)
|
sendMarkup("File/Folder is already available in Drive.\nHere are the search results:", self.__listener.bot, self.__listener.update, button)
|
||||||
return
|
return
|
||||||
|
|
|
||||||
|
|
@ -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
|
self.stopDup = stopDup
|
||||||
msg = ""
|
msg = ""
|
||||||
if not stopDup:
|
if not stopDup:
|
||||||
|
|
@ -694,7 +694,9 @@ class GoogleDriveHelper:
|
||||||
Title = False
|
Title = False
|
||||||
for index, parent_id in enumerate(DRIVES_IDS):
|
for index, parent_id in enumerate(DRIVES_IDS):
|
||||||
response = self.drive_query(parent_id, fileName)
|
response = self.drive_query(parent_id, fileName)
|
||||||
if not response["files"]:
|
if not response["files"] and noMulti:
|
||||||
|
break
|
||||||
|
elif not response["files"]:
|
||||||
continue
|
continue
|
||||||
if not Title:
|
if not Title:
|
||||||
msg += f'<h4>Search Result For: {fileName}</h4><br><br>'
|
msg += f'<h4>Search Result For: {fileName}</h4><br><br>'
|
||||||
|
|
@ -761,7 +763,7 @@ class GoogleDriveHelper:
|
||||||
self.telegraph_content.append(msg)
|
self.telegraph_content.append(msg)
|
||||||
msg = ""
|
msg = ""
|
||||||
content_count = 0
|
content_count = 0
|
||||||
if clone:
|
if noMulti:
|
||||||
break
|
break
|
||||||
|
|
||||||
if msg != '':
|
if msg != '':
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue