diff --git a/.idea/workspace.xml b/.idea/workspace.xml
index f330574..cdba472 100644
--- a/.idea/workspace.xml
+++ b/.idea/workspace.xml
@@ -3,9 +3,9 @@
-
-
-
+
+
+
@@ -40,51 +40,52 @@
-
+
-
-
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -93,38 +94,8 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
@@ -133,7 +104,7 @@
-
+
@@ -143,14 +114,14 @@
-
-
+
+
-
+
@@ -167,8 +138,48 @@
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -190,17 +201,19 @@
@@ -510,7 +523,11 @@
1420834735779
1420834735779
-
+
+ 1420904827834
+ 1420904827834
+
+
@@ -537,7 +554,7 @@
-
+
@@ -549,12 +566,12 @@
-
+
-
+
@@ -574,7 +591,8 @@
-
+
+
@@ -582,50 +600,229 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -634,7 +831,6 @@
-
@@ -650,7 +846,6 @@
-
@@ -669,115 +864,10 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
@@ -793,7 +883,6 @@
-
@@ -813,6 +902,126 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/Core.py b/Core.py
index ff4aa6d..7558f0f 100644
--- a/Core.py
+++ b/Core.py
@@ -81,7 +81,7 @@ class Core:
def sectionMenu(self):
if self.__settings__.getSetting('plugin_name')!=self.__plugin__:
if self.__settings__.getSetting('delete_russian')!='false':
- not_russian=delete_russian(self.__settings__.getSetting('delete_russian')=='true')
+ not_russian=delete_russian(ok=self.__settings__.getSetting('delete_russian')=='true', action='delete')
if not_russian:
self.__settings__.setSetting('delete_russian', 'true')
self.__settings__.setSetting('language', '0')
@@ -1603,3 +1603,7 @@ class Core:
return Localization.localize(string)
except:
return string
+
+ def returnRussian(self, params={}):
+ i=delete_russian(ok=True, action='return')
+ showMessage(self.localize('Return Russian stuff'),self.localize('%d files have been returned')%i)
\ No newline at end of file
diff --git a/Localization.py b/Localization.py
index 8ebe854..4f83673 100644
--- a/Localization.py
+++ b/Localization.py
@@ -197,6 +197,8 @@ dictionary = {
'International Check - First Run':'International Check - Первый запуск',
'Delete Russian stuff?':'Удалить русские трекеры?',
'Save to path':'Сохранить в папку',
+ 'Return Russian stuff':'Вернуть русские трекеры',
+ '%d files have been returned':'%d файлов возвращено',
}
}
diff --git a/addon.xml b/addon.xml
index 2d7a6d3..a351118 100644
--- a/addon.xml
+++ b/addon.xml
@@ -1,5 +1,5 @@
-
+
diff --git a/functions.py b/functions.py
index a4a70c8..31887f6 100644
--- a/functions.py
+++ b/functions.py
@@ -1563,7 +1563,8 @@ def isSubtitle(filename, filename2):
return True
return False
-def delete_russian(ok=False):
+def delete_russian(ok=False, action='delete'):
+ i=0
if not ok:
ok = xbmcgui.Dialog().yesno('< %s >' % Localization.localize('International Check - First Run'),
'Delete Russian stuff?',
@@ -1576,11 +1577,22 @@ def delete_russian(ok=False):
for path in fileList.keys():
for filename in fileList[path]:
- filepath=os.path.join(ROOT,'resources', path,filename)
- if xbmcvfs.exists(filepath):
- newfilepath=os.path.join(ROOT,'resources', path,'unused',filename)
- xbmcvfs.copy(filepath, newfilepath)
- xbmcvfs.delete(filepath)
+ if action=='delete':
+ filepath=os.path.join(ROOT,'resources', path,filename)
+ if xbmcvfs.exists(filepath):
+ newfilepath=os.path.join(ROOT,'resources', path,'unused',filename)
+ xbmcvfs.copy(filepath, newfilepath)
+ xbmcvfs.delete(filepath)
+ elif action=='return':
+ filepath=os.path.join(ROOT,'resources', path,'unused',filename)
+ if xbmcvfs.exists(filepath):
+ newfilepath=os.path.join(ROOT,'resources',path,filename)
+ xbmcvfs.copy(filepath, newfilepath)
+ xbmcvfs.delete(filepath)
+ i=i+1
+
+ if action=='return':
+ return i
return True
else:
return False
\ No newline at end of file
diff --git a/resources/language/English/strings.xml b/resources/language/English/strings.xml
index 24f5504..9d25a07 100644
--- a/resources/language/English/strings.xml
+++ b/resources/language/English/strings.xml
@@ -29,6 +29,8 @@
Predownload subtitles from all folders
Keep seeding until Kodi restart
Ask to change storage before play
+ Delete Russian stuff
+ Return Russian stuff
Interface
P2P Network
Save path
diff --git a/resources/language/Russian/strings.xml b/resources/language/Russian/strings.xml
index 1d3a7cd..0204c2e 100644
--- a/resources/language/Russian/strings.xml
+++ b/resources/language/Russian/strings.xml
@@ -29,6 +29,8 @@
Предзакачать и подключить субтитры
Сидировать до полного выключения Kodi
Предлагать изменить место хранения
+ Удалить русские трекеры
+ Вернуть русские трекеры
Интерфейс
P2P Сеть
Директория для сохранения файлов
diff --git a/resources/settings.xml b/resources/settings.xml
index 0278e66..cf4b6ee 100644
--- a/resources/settings.xml
+++ b/resources/settings.xml
@@ -7,6 +7,17 @@
label="30001"
default="1"
/>
+
+