Skip to content

Commit

Permalink
Changes see changelog.txt
Browse files Browse the repository at this point in the history
  • Loading branch information
rols1 committed Dec 2, 2019
1 parent a049eed commit 1b89f19
Show file tree
Hide file tree
Showing 9 changed files with 404 additions and 312 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ ported from FlickrExplorer (https://github.com/rols1/FlickrExplorer)
Download aktuelle Version: https://github.com/rols1/Kodi-Addon-FlickrExplorer/releases

#### Rückmeldungen im Forum willkommen / Feedeback welcome:
Support-Thread: https://forum.kodi.tv/showthread.php?tid=347210 <br>
Support-Thread: will be added <br>
EMail: rols1@gmx.de

#### Functions tested Linux/Kodi 18.3, Win7/Kodi 18.1, Android 7.0/Kodi 18.3, Raspi 3b+/LibreELEC 9.0.1
Expand Down
3 changes: 2 additions & 1 deletion addon.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<addon id="plugin.image.flickrexplorer" name="FlickrExplorer" version="0.6.3" provider-name="rols1 (rols1@gmx.de)">
<addon id="plugin.image.flickrexplorer" name="FlickrExplorer" version="0.6.6" provider-name="rols1 (rols1@gmx.de)">
<requires>
<import addon="xbmc.python" version="2.25.0"/>
<import addon="script.module.kodi-six" />
</requires>
<extension point="xbmc.python.pluginsource" library="flickrexplorer.py">
<provides>image</provides>
Expand Down
21 changes: 21 additions & 0 deletions changelog.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,27 @@ CHANGE HISTORY Kodi-Addon-FlickrExplorer
Forum: https://forum.kodi.tv/showthread.php?tid=347210
--------------

02.12.2019 0.6.6 Adaptation Kodi Matrix (compatibility Python2/Python3:
Modul updater: replaced with update-Modul from TuneIn2017.
addon.xml: dependency for script.module.kodi-six added.
Tests with Windows10 + Kodi Matrix (Git:20191128-19f60fecab) OK.

not on github 0.6.5 Adaptation Kodi Matrix (compatibility Python2/Python3:
Main / SearchUpdate: Fix reaction on Github-problem (interpretation of
updater return was wrong).
Main: getHeaders removed (also in util_flickr) - not used.
Main: try/except for building OS_DETECT-string (IOError possible on iOS ARM 32-bit).
All quoted args for fparams treated with py2_encode, all UtfToStr-calls
removed.

not on github 0.6.4 Adaptation Kodi Matrix (compatibility Python2/Python3:
Modul util_flickr: decode('utf-8') replaced from ADDON_PATH, msg.encoding
removed in PLog(), old content in UtfToStr() replaced with py2_encode, all
in-Args in addDir treated with py2_encode, all terms in repl_json_chars() set
to unicode, dto. in unescape(), dto. in transl_json, dto. in repl_json_chars,
no page.decode('utf-8') in RequestUrl if content is video.
RLoad (Modul util_tunein2017): encoding="utf8" for reading file on PYTHON3.

04.10.2019 0.6.3 ShowPhotoObject: background process for loading pics from flickr (performance).
ShowPhotoObject: create a ListItem for every pic (make browsing in the image list possible).

Expand Down
290 changes: 163 additions & 127 deletions flickrexplorer.py

Large diffs are not rendered by default.

Binary file modified icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
55 changes: 40 additions & 15 deletions resources/lib/updater.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,33 @@
#
#
################################################################################
import re, os, sys
import shutil # Dir's löschen
import urllib2, zipfile, StringIO
# 01.12.2019 Migration Python3 Modul kodi_six + manuelle Anpassungen
################################################################################

# Python3-Kompatibilität:
from __future__ import absolute_import # sucht erst top-level statt im akt. Verz.
from __future__ import division # // -> int, / -> float
from __future__ import print_function # PYTHON2-Statement -> Funktion
from kodi_six import xbmc, xbmcaddon, xbmcplugin, xbmcgui, xbmcvfs
# o. Auswirkung auf die unicode-Strings in PYTHON3:
from kodi_six.utils import py2_encode, py2_decode

import xbmc, xbmcgui, xbmcaddon
import os, sys
PYTHON2 = sys.version_info.major == 2
PYTHON3 = sys.version_info.major == 3
if PYTHON2:
from urllib import quote, unquote, quote_plus, unquote_plus, urlencode, urlretrieve
from urllib2 import Request, urlopen, URLError
from urlparse import urljoin, urlparse, urlunparse , urlsplit, parse_qs
elif PYTHON3:
from urllib.parse import quote, unquote, quote_plus, unquote_plus, urlencode, urljoin, urlparse, urlunparse, urlsplit, parse_qs
from urllib.request import Request, urlopen, urlretrieve
from urllib.error import URLError

# Standard:
import shutil # Dir's löschen
import zipfile, re
import io # Python2+3 -> update() io.BytesIO für Zipfile

import resources.lib.util_flickr as util
PLog=util.PLog; stringextract=util.stringextract;
Expand All @@ -17,7 +39,7 @@
ADDON_ID = 'plugin.image.flickrexplorer'
SETTINGS = xbmcaddon.Addon(id=ADDON_ID)
ADDON_NAME = SETTINGS.getAddonInfo('name')
ADDON_PATH = SETTINGS.getAddonInfo('path').decode('utf-8')
ADDON_PATH = SETTINGS.getAddonInfo('path')

FEED_URL = 'https://github.com/{0}/releases.atom'

Expand All @@ -37,8 +59,9 @@ def get_latest_version():
release_feed_url = ('https://github.com/{0}/releases.atom'.format(GITHUB_REPOSITORY))
PLog(release_feed_url)

r = urllib2.urlopen(release_feed_url)
r = urlopen(release_feed_url)
page = r.read()
page=page.decode('utf-8')
PLog(len(page))
# PLog(page[:800])

Expand All @@ -52,10 +75,11 @@ def get_latest_version():
# PLog(link); PLog(title); PLog(summary); PLog(tag);
return (title, summary, tag)
except Exception as exception:
Log.Error('Suche nach neuen Versionen fehlgeschlagen: {0}'.format(repr(exception)))
PLog(str(exception))
return ('', '', '')

################################################################################
# decode latest_version (hier bytestring) erforderlich für Pfad-Bau in
def update_available(VERSION):
PLog('update_available:')

Expand All @@ -71,16 +95,17 @@ def update_available(VERSION):
# wir verwenden auf Github die Versionierung nicht im Plugin-Namen
# latest_version = title
latest_version = tag # Format hier: '1.4.1'

current_version = VERSION
int_lv = tag.replace('.','')
int_cv = current_version.replace('.','')
PLog('Github: ' + latest_version); PLog('lokal: ' + current_version);
# PLog(int_lv); PLog(int_cv)
return (int_lv, int_cv, latest_version, summ, tag)
except:
pass
return (False, '', '', '', '', '')

except Exception as exception:
PLog(str(exception))
return (False, '', '', '', '', '') # int_lv hier bool statt string
################################################################################
def update(url, ver):
PLog('update:')
Expand All @@ -91,9 +116,9 @@ def update(url, ver):
try:
dest_path = xbmc.translatePath("special://home/addons/")
PLog('Mark1')
r = urllib2.urlopen(url)
r = urlopen(url)
PLog('Mark2')
zip_data = zipfile.ZipFile(StringIO.StringIO(r.read()))
zip_data = zipfile.ZipFile(io.BytesIO(r.read()))
PLog('Mark3')

# save_restore('save') # Cache sichern - entfällt, s.o.
Expand All @@ -114,7 +139,6 @@ def update(url, ver):
msg1 = 'Update fehlgeschlagen'
msg2 = 'Version ' + ver + 'nicht gefunden!'
xbmcgui.Dialog().ok(ADDON_NAME, msg1, msg2, '')
return

################################################################################
# save_restore: Cache sichern / wieder herstellen
Expand All @@ -124,7 +148,8 @@ def update(url, ver):
# 03.05.2019 Funktion wieder entfernt - s.o.


################################################################################# clean tag names based on your release naming convention
#################################################################################
# clean tag names based on your release naming convention
def cleanSummary(summary):

summary = (summary.replace('&lt;','').replace('&gt;','').replace('/ul','')
Expand Down
Binary file removed resources/lib/updater.pyo
Binary file not shown.
Loading

0 comments on commit 1b89f19

Please sign in to comment.