Skip to content

Commit

Permalink
Last version
Browse files Browse the repository at this point in the history
  • Loading branch information
mtester270 committed May 3, 2019
1 parent 72928ba commit 5bf498b
Show file tree
Hide file tree
Showing 6 changed files with 238 additions and 6 deletions.
8 changes: 8 additions & 0 deletions build/plugin/po/cs.po
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,14 @@ msgstr "(Trakt) Označit jako viděno"
msgid "(Trakt) Mark as not watched"
msgstr "(Trakt) Označit jako neviděno"

msgid "Install ArchivCZSK premium complete."
msgstr "Instalace ArchivCZSK premium úspěšná."
msgid "Do you want to try ArchivCZSK premium?"
msgstr "Přejete si vyzkoušet ArchivCZSK premium?"
msgid "More info: "
msgstr "Více info: "
msgid "Remove old ArchivCZSK?"
msgstr "Vymazat starý ArchivCZSK (většina nastavení bude přenesena)?"

msgid "Exit"
msgstr "Ukončit"
Expand Down
10 changes: 10 additions & 0 deletions build/plugin/po/sk.po
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,16 @@ msgstr "(Trakt) Označiť ako videné"
msgid "(Trakt) Mark as not watched"
msgstr "(Trakt) Označiť ako nevidené"

msgid "Install ArchivCZSK premium complete."
msgstr "Nainštalovanie ArchivCZSK premium úspešné."
msgid "Do you want to try ArchivCZSK premium?"
msgstr "Želáte si vyskúšať ArchivCZSK premium?"
msgid "More info: "
msgstr "Viac info: "
msgid "Remove old ArchivCZSK?"
msgstr "Vymazať starý ArchivCZSK (väčšina nastavení bude prenesená)?"



msgid "Exit"
msgstr "Ukončiť"
Expand Down
6 changes: 4 additions & 2 deletions build/plugin/src/changelog.txt
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
archivCZSK 1.1.3, xxx
archivCZSK 1.2.0, 03.05.2019
---------------------------------------------
- drobne opravy
- neposielanie cmdStats ked to doplnok nepodporuje
- timeout 60sek pre zatvorenie spravy o dokonceni stahovania
-
- drobna uprava skinov
- odstranena poziadavka na subsupport pri instalacii .ipk
- moznost prechodu na premiovu verziu

archivCZSK 1.1.2, 14.11.2018
---------------------------------------------
Expand Down
3 changes: 2 additions & 1 deletion build/plugin/src/engine/handlers/media.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,8 @@ def open_item_error_cb(failure):
def play_item(self, item, mode='play', *args, **kwargs):
def endPlayFinish():
self.content_screen.workingFinished()
self.content_provider.resume()
if self.content_provider.isPaused():
self.content_provider.resume()
def startWatchingTimer():
self.cmdTimer.start(timerPeriod)
def timerEvent():
Expand Down
215 changes: 213 additions & 2 deletions build/plugin/src/engine/updater.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,14 @@
import traceback
import threading
from tools import unzip, util, parser
from distutils import dir_util
from Plugins.Extensions.archivCZSK.engine.exceptions.updater import UpdateXMLVersionError
from Plugins.Extensions.archivCZSK import _, log, toString, settings
from Components.Console import Console
from Components.config import config
from Components.config import config, ConfigSubsection, ConfigText, ConfigYesNo
from Screens.MessageBox import MessageBox

ConfigSubsection
def removePyOC(pyfile):
if os.path.isfile(pyfile + 'c'):
log.debug('removing %s', (pyfile + 'c'))
Expand Down Expand Up @@ -48,9 +50,10 @@ def __init__(self, archivInstance):
self.updateZip = "http://cdn.rawgit.com/mx3L/archivczsk/{commit}/build/plugin/update/version/archivczsk-{version}.zip"
self.commit = "https://raw.githubusercontent.com/mx3L/archivczsk/master/build/plugin/update/commit"
self.needUpdate = False
self.migration = {}

def checkUpdate(self):
self.downloadCommit()
self.showUpdatePremium()


def downloadCommit(self):
Expand Down Expand Up @@ -298,6 +301,214 @@ def removeTempFiles(self):
log.logError("ArchivUpdater remove temp files failed.\n%s"%traceback.format_exc())
pass

def showUpdatePremium(self):
try:
if not os.path.isdir(os.path.join(settings.ENIGMA_PLUGIN_PATH,'archivCZSKpremium')):
strMsg = _('Do you want to try ArchivCZSK premium?')+'\n\n'
strMsg += _('More info: ')+'https://czsk.page.link/inf\n'
self.archiv.session.openWithCallback(self.showUpdatePremium2,
MessageBox,
strMsg,
type=MessageBox.TYPE_YESNO)
else:
self.downloadCommit()
except:
log.logDebug("checkUpdateRequest failed.\n%s"%traceback.format_exc())
self.downloadCommit()
def showUpdatePremium2(self, callback=None):
if not callback:
self.downloadCommit()
else:
strMsg = _('Remove old ArchivCZSK?')+'\n'
self.archiv.session.openWithCallback(self.updatePremium,
MessageBox,
strMsg,
type=MessageBox.TYPE_YESNO,
default=False)

def getSetting(self, addonId, setting_key):
try:
setattr(config.plugins.archivCZSK.archives, addonId, ConfigSubsection())
main = getattr(config.plugins.archivCZSK.archives, addonId)
setattr(main, '%s' % setting_key, ConfigText(default=''))
setting = getattr(main, '%s' % setting_key)
return setting.getValue()
except:
log.logError("Get setting '%s.%s' failed.%s"%(addonId, setting_key, traceback.format_exc()))
def saveSetting(self, addonId, setting_key, val, firstTime=False):
try:

if firstTime:
setattr(config.plugins, 'archivCZSKpremium', ConfigSubsection())
root1 = getattr(config.plugins, 'archivCZSKpremium')
setattr(root1, 'archives', ConfigSubsection())
root = getattr(root1, 'archives')
setattr(root, '%s'%addonId, ConfigSubsection())
main = getattr(root, '%s'%addonId)
else:
if addonId not in self.migration.keys():
setattr(config.plugins.archivCZSKpremium.archives, '%s'%addonId, ConfigSubsection())
main = getattr(config.plugins.archivCZSKpremium.archives, '%s'%addonId)
else:
main = getattr(config.plugins.archivCZSKpremium.archives, '%s'%addonId)

if addonId not in self.migration.keys():
self.migration[addonId]=1

setattr(main, '%s'%setting_key, ConfigText(default='', fixed_size=False))
sett = getattr(main, '%s'%setting_key)
sett.setValue(val)
sett.save()
except:
log.logError("Save setting '%s.%s' failed.%s"%(addonId, setting_key, traceback.format_exc()))
def getSettingArchiv(self, setting_key):
try:
setattr(config.plugins.archivCZSK, '%s' % setting_key, ConfigText(default=''))
setting = getattr(config.plugins.archivCZSK, '%s' % setting_key)
return setting.getValue()
except:
log.logError("Get setting '%s' failed.%s"%(setting_key, traceback.format_exc()))
def saveSettingArchiv(self, setting_key, val):
try:
setattr(config.plugins.archivCZSKpremium, '%s'%setting_key, ConfigText(default='', fixed_size=False))
sett = getattr(config.plugins.archivCZSKpremium, '%s'%setting_key)
sett.setValue(val)
sett.save()
except:
log.logError("Save setting '%s' failed.%s"%(setting_key, traceback.format_exc()))

def updatePremium(self, callback=None):
try:
#download ZIP
util.download_to_file('https://raw.githubusercontent.com/mtester270/archivczskpremium/master/archiv.zip', '/tmp/archivpremium.zip')
#unpack
unzipper = unzip.unzip()
exDir = '/tmp/archivpremiumuzip'
if os.path.isdir(exDir):
shutil.rmtree(exDir)
os.mkdir(exDir)
unzipper.extract('/tmp/archivpremium.zip', exDir)
os.remove('/tmp/archivpremium.zip')
#copy
shutil.copytree(os.path.join(exDir, 'archivCZSKpremium'), os.path.join(settings.ENIGMA_PLUGIN_PATH, 'archivCZSKpremium'))
pthsite =os.path.join(exDir, 'site-packages')
for i in os.listdir(pthsite):
sitepck = os.path.join(pthsite,i)
cpDir = os.path.join('/usr/lib/python2.7/site-packages', i)
if not os.path.isdir(cpDir):
log.logDebug("UpdatePremium: add site-pckage %s"%i)
shutil.copytree(sitepck, cpDir)
else:
log.logDebug("UpdatePremium: site-pckage %s already installed"%i)
shutil.rmtree(exDir)


#some custom setting
val = self.getSetting('plugin_video_sosac_ph', 'streamujtv_user')
self.saveSetting('plugin_video_sosac_ph', 'streamujtv_user', val, True)
val = self.getSetting('plugin_video_sosac_ph', 'streamujtv_pass')
self.saveSetting('plugin_video_sosac_ph', 'streamujtv_pass', val)
val = self.getSetting('plugin_video_sosac_ph', 'auto_addon_order')
self.saveSetting('plugin_video_sosac_ph', 'auto_addon_order', val)
val = self.getSetting('plugin_video_orangetv', 'orangetvuser')
self.saveSetting('plugin_video_orangetv', 'orangetvuser', val)
val = self.getSetting('plugin_video_orangetv', 'orangetvpwd')
self.saveSetting('plugin_video_orangetv', 'orangetvpwd', val)
val = self.getSetting('plugin_video_orangetv', 'auto_addon_order')
self.saveSetting('plugin_video_orangetv', 'auto_addon_order', val)
val = self.getSetting('plugin_video_stream-cinema', 'wsuser')
self.saveSetting('plugin_video_stream-cinema', 'wsuser', val)
val = self.getSetting('plugin_video_stream-cinema', 'wspass')
self.saveSetting('plugin_video_stream-cinema', 'wspass', val)
val = self.getSetting('plugin_video_stream-cinema', 'trakt_enabled')
self.saveSetting('plugin_video_stream-cinema', 'trakt_enabled', val)
val = self.getSetting('plugin_video_stream-cinema', 'deviceid')
self.saveSetting('plugin_video_stream-cinema', 'deviceid', val)
val = self.getSetting('plugin_video_stream-cinema', 'trakt_filter')
self.saveSetting('plugin_video_stream-cinema', 'trakt_filter', val)
val = self.getSetting('plugin_video_stream-cinema', 'trakt_token')
self.saveSetting('plugin_video_stream-cinema', 'trakt_token', val)
val = self.getSetting('plugin_video_stream-cinema', 'trakt_refresh_token')
self.saveSetting('plugin_video_stream-cinema', 'trakt_refresh_token', val)
val = self.getSetting('plugin_video_stream-cinema', 'trakt_token_expire')
self.saveSetting('plugin_video_stream-cinema', 'trakt_token_expire', val)
val = self.getSetting('plugin_video_stream-cinema', 'use_https')
self.saveSetting('plugin_video_stream-cinema', 'use_https', val)
val = self.getSetting('plugin_video_stream-cinema', 'auto_addon_order')
self.saveSetting('plugin_video_stream-cinema', 'auto_addon_order', val)
val = self.getSetting('plugin_video_o2tv', 'o2tvuser')
self.saveSetting('plugin_video_o2tv', 'o2tvuser', val)
val = self.getSetting('plugin_video_o2tv', 'o2tvpwd')
self.saveSetting('plugin_video_o2tv', 'o2tvpwd', val)
val = self.getSetting('plugin_video_o2tv', 'login_method')
self.saveSetting('plugin_video_o2tv', 'login_method', val)
val = self.getSetting('plugin_video_o2tv', 'deviceid')
self.saveSetting('plugin_video_o2tv', 'deviceid', val)
val = self.getSetting('plugin_video_o2tv', 'auto_addon_order')
self.saveSetting('plugin_video_o2tv', 'auto_addon_order', val)
val = self.getSetting('plugin_video_online-files', 'webshare_enabled')
self.saveSetting('plugin_video_online-files', 'webshare_enabled', val)
val = self.getSetting('plugin_video_online-files', 'webshare_user')
self.saveSetting('plugin_video_online-files', 'webshare_user', val)
val = self.getSetting('plugin_video_online-files', 'webshare_pass')
self.saveSetting('plugin_video_online-files', 'webshare_pass', val)
val = self.getSetting('plugin_video_online-files', 'auto_addon_order')
self.saveSetting('plugin_video_online-files', 'auto_addon_order', val)
val = self.getSetting('plugin_video_markiza_sk', 'auto_addon_order')
self.saveSetting('plugin_video_markiza_sk', 'auto_addon_order', val)
val = self.getSetting('plugin_video_joj_sk', 'auto_addon_order')
self.saveSetting('plugin_video_joj_sk', 'auto_addon_order', val)
val = self.getSetting('plugin_video_rtvs_sk', 'auto_addon_order')
self.saveSetting('plugin_video_rtvs_sk', 'auto_addon_order', val)

self.saveSettingArchiv('skin', self.getSettingArchiv('skin'))
self.saveSettingArchiv('showVideoInfo', self.getSettingArchiv('showVideoInfo'))
self.saveSettingArchiv('downloadPoster', self.getSettingArchiv('downloadPoster'))
self.saveSettingArchiv('posterImageMax', self.getSettingArchiv('posterImageMax'))
self.saveSettingArchiv('csfdMode', self.getSettingArchiv('csfdMode'))
self.saveSettingArchiv('downloadsPath', self.getSettingArchiv('downloadsPath'))
self.saveSettingArchiv('posterPath', self.getSettingArchiv('posterPath'))
self.saveSettingArchiv('tmpPath', self.getSettingArchiv('tmpPath'))
self.saveSettingArchiv('defaultCategory', self.getSettingArchiv('defaultCategory'))
self.saveSettingArchiv('clearMemory', self.getSettingArchiv('clearMemory'))


# save settings
bcpPath = '/tmp/oldarchivBackup'
pth = settings.PLUGIN_PATH
if os.path.isdir(bcpPath):
shutil.rmtree(bcpPath)
os.mkdir(bcpPath)
os.mkdir(os.path.join(bcpPath,'resources'))
osr = os.path.join(pth, 'osref.pyo')
if os.path.isfile(osr):
shutil.copyfile(osr, os.path.join(bcpPath, 'osref.pyo'))
shutil.copyfile(os.path.join(pth, 'categories.xml'),os.path.join(bcpPath, 'categories.xml'))
if os.path.isdir(os.path.join(pth,'resources')):
dir_util.copy_tree(os.path.join(pth,'resources','data'),os.path.join(bcpPath,'resources','data'))

# remove old archivCZSK
if callback:
shutil.rmtree(pth)


#restore
if os.path.isfile(os.path.join(bcpPath, 'osref.pyo')):
shutil.copy(os.path.join(bcpPath, 'osref.pyo'), os.path.join(settings.ENIGMA_PLUGIN_PATH,'archivCZSKpremium'))
shutil.copy(os.path.join(bcpPath, 'categories.xml'), os.path.join(settings.ENIGMA_PLUGIN_PATH,'archivCZSKpremium'))
if os.path.exists(os.path.join(bcpPath,'resources','data')):
dir_util.copy_tree(os.path.join(bcpPath,'resources','data'), os.path.join(settings.ENIGMA_PLUGIN_PATH,'archivCZSKpremium','resources','data'))
shutil.rmtree(bcpPath)

strMsg = "%s" % _("Install ArchivCZSK premium complete.")
self.archiv.session.openWithCallback(self.archiv.ask_restart_e2,
MessageBox,
strMsg,
type=MessageBox.TYPE_INFO)
except:
log.logDebug("UpdatePremium failed.\n%s"%traceback.format_exc())
self.downloadCommit()

class Updater(object):
"""Updater for updating addons in repository, every repository has its own updater"""

Expand Down
2 changes: 1 addition & 1 deletion build/plugin/src/version.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from . import _

title = _("ArchivCZSK")
version = "1.1.2"
version = "1.2.0"
author = "mx3L,chaoss"
description = _("Playing CZ/SK archives")
url = "https://github.com/mx3L/archivczsk/"
Expand Down

0 comments on commit 5bf498b

Please sign in to comment.