diff --git a/Anteoloader.py b/Anteoloader.py index 7b4be6a..e8cb03d 100644 --- a/Anteoloader.py +++ b/Anteoloader.py @@ -155,10 +155,24 @@ class AnteoLoader: self.engine.start() #media_types=[MediaType.VIDEO, MediaType.AUDIO, MediaType.SUBTITLES, MediaType.UNKNOWN] - while not files and not xbmc.abortRequested: + iterator = 0 + text = Localization.localize('Magnet-link is converting') if self.magnetLink\ + else Localization.localize('Opening torrent file') + while not files and not xbmc.abortRequested and iterator < 100: files = self.engine.list() self.engine.check_torrent_error() - xbmc.sleep(200) + if iterator==4: + progressBar = xbmcgui.DialogProgress() + progressBar.create(Localization.localize('Please Wait'), + Localization.localize('Magnet-link is converting')) + elif iterator>4: + progressBar.update(iterator, Localization.localize('Please Wait'),text+'.' * (iterator % 4), ' ') + if progressBar.iscanceled(): + progressBar.update(0) + progressBar.close() + return [] + xbmc.sleep(500) + iterator += 1 for fs in files: stringdata = {"title": fs.name, "size": fs.size, "ind": fs.index, diff --git a/Localization.py b/Localization.py index de5c23e..33fcff5 100644 --- a/Localization.py +++ b/Localization.py @@ -272,6 +272,7 @@ def localize(text): 'Do it!':'Скажите "ДА"!', 'Please, restart Kodi now!':'Теперь перезагрузите Коди, пожалуйста!', './ (Root folder)':'./ (Корневой каталог)', + 'Opening torrent file':'Открытие torrent-файла', }, 'uk': { 'Seeds searching.': 'Йде пошук сідів.',