The branch, frodo has been updated
via 0d45763b98074a7f7bbb4d86bf36bb5497bdb8d3 (commit)
via 987f5b914bf117c9ce0ec14ee9d0f6fe1c0c24ea (commit)
from 0d690a3c627566d025f7860de1e3f81a957f5260 (commit)
- Log -----------------------------------------------------------------
http://xbmc.git.sourceforge.net/git/gitweb.cgi?p=xbmc/plugins;a=commit;h=0d45763b98074a7f7bbb4d86bf36bb5497bdb8d3
commit 0d45763b98074a7f7bbb4d86bf36bb5497bdb8d3
Author: sphere <[email protected]>
Date: Wed Apr 23 11:27:37 2014 +0200
[plugin.image.500px] updated to version 0.2.2
diff --git a/plugin.image.500px/addon.xml b/plugin.image.500px/addon.xml
index 927f720..3e5385e 100644
--- a/plugin.image.500px/addon.xml
+++ b/plugin.image.500px/addon.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
-<addon id="plugin.image.500px" name="500px" version="0.2.1"
+<addon id="plugin.image.500px" name="500px" version="0.2.2"
provider-name="Patrick L Archibald [[email protected]],
Clément MATHIEU [[email protected]]">
<requires>
<import addon="script.module.simplejson" version="2.0.10"/>
@@ -12,11 +12,16 @@
<extension point="xbmc.addon.metadata">
<platform>all</platform>
<summary lang="en">View photos from http://500px.com.</summary>
- <description>
+ <description lang="en">
View photos from http://500px.com. In the addon settings you can change
the quantity of photos per page to
view 20 (default), 40, 60, 80, 100. This addon was created by Patrick L
Archibald at http://pla1.net.
The source for this addon can be found at
https://github.com/pla1/plugin.image.500px.
</description>
<license>GPL 2.0</license>
+ <language>en</language>
+ <forum>https://github.com/pla1/plugin.image.500px/issues</forum>
+ <website>https://github.com/pla1/plugin.image.500px</website>
+ <source>https://github.com/pla1/plugin.image.500px</source>
+ <email>[email protected]</email>
</extension>
</addon>
diff --git a/plugin.image.500px/changelog.txt b/plugin.image.500px/changelog.txt
index 0c93e28..ebf99b4 100644
--- a/plugin.image.500px/changelog.txt
+++ b/plugin.image.500px/changelog.txt
@@ -1,3 +1,5 @@
+Version 0.2.2 - April 21, 2014
+- Fixes search when entering an empty string or when dismissing the search
dialog.
Version 0.2.1 - June 21, 2013
- Rename module utils to resolve a confict.
Version 0.2.0 - June 19, 2013
diff --git a/plugin.image.500px/default.py b/plugin.image.500px/default.py
index f5ed216..c43e5fe 100644
--- a/plugin.image.500px/default.py
+++ b/plugin.image.500px/default.py
@@ -3,9 +3,13 @@ import fivehundredpxutils
import fivehundredpxutils.xbmc
import xbmc
+import xbmcaddon
import xbmcgui
import xbmcplugin
+__addon__ = xbmcaddon.Addon()
+__addonname__ = __addon__.getAddonInfo('name')
+
from fivehundredpx.client import FiveHundredPXAPI
_CONSUMER_KEY = 'LvUFQHMQgSlaWe3aRQot6Ct5ZC2pdTMyTLS0GMfF'
@@ -15,9 +19,11 @@ API = FiveHundredPXAPI()
class Image(object):
def __init__(self, photo_json):
- self.name= photo_json['name']
+ self.name = photo_json['name']
self.thumb_url = photo_json['images'][0]['url']
self.url = photo_json['images'][1]['url']
+ self.userid = photo_json['user']['username']
+ self.userfullname = photo_json['user']['fullname']
def __repr__(self):
return str(self.__dict__)
@@ -46,24 +52,35 @@ def search():
def getTerm():
kb = xbmc.Keyboard(heading='Search 500px')
kb.doModal()
- return kb.getText()
+ text = kb.getText()
+ return text if kb.isConfirmed() and text else None
params = fivehundredpxutils.xbmc.addon_params
if 'term' not in params:
term = getTerm()
+ if term == None:
+ return
page = 1
else:
term = params['term']
- page = int(params['page'])
+ page = int(params.get('page', 1))
resp = API.photos_search(term=term, rpp=_RPP, consumer_key=_CONSUMER_KEY,
image_size=[2, 4], page=page)
+
+ if (resp['total_items'] == 0):
+ xbmc.executebuiltin('Notification(%s, %s)' % (__addonname__, "Your
search returned no matches."))
+ return
+
for image in map(Image, resp['photos']):
fivehundredpxutils.xbmc.add_image(image)
if resp['current_page'] != resp['total_pages']:
next_page = page + 1
- url = fivehundredpxutils.xbmc.encode_child_url('search', term=term,
page=next_page)
+ if 'ctxsearch' in params:
+ url = fivehundredpxutils.xbmc.encode_child_url('search',
term=term, page=next_page, ctxsearch=True)
+ else:
+ url = fivehundredpxutils.xbmc.encode_child_url('search',
term=term, page=next_page)
fivehundredpxutils.xbmc.add_dir('Next page', url)
fivehundredpxutils.xbmc.end_of_directory()
@@ -75,7 +92,8 @@ def features():
"popular",
"upcoming",
"fresh_today",
- "fresh_yesterday"
+ "fresh_yesterday",
+ "fresh_week"
)
for feature in features:
@@ -95,7 +113,7 @@ def categories():
'Animals': 11,
'Black and White': 5,
'Celebrities': 1,
- 'City': 9,
+ 'City and Architecture': 9,
'Commercial': 15,
'Concert': 16,
'Family': 20,
@@ -116,7 +134,7 @@ def categories():
'Transportation': 26,
'Travel': 13,
'Underwater': 22,
- 'Urban': 27,
+ 'Urban Exploration': 27,
'Wedding': 25,
}
diff --git a/plugin.image.500px/resources/lib/fivehundredpxutils/__init__.py
b/plugin.image.500px/resources/lib/fivehundredpxutils/__init__.py
index 1314b7b..0d303e8 100644
--- a/plugin.image.500px/resources/lib/fivehundredpxutils/__init__.py
+++ b/plugin.image.500px/resources/lib/fivehundredpxutils/__init__.py
@@ -3,7 +3,6 @@
def print_ret_val(f):
def decorated(*args, **kwargs):
ret = f(*args, **kwargs)
- print "%s returned value %s" % (f.__name__, ret)
return ret
- return decorated
\ No newline at end of file
+ return decorated
diff --git a/plugin.image.500px/resources/lib/fivehundredpxutils/xbmc.py
b/plugin.image.500px/resources/lib/fivehundredpxutils/xbmc.py
index 583e2a4..d1c90bb 100644
--- a/plugin.image.500px/resources/lib/fivehundredpxutils/xbmc.py
+++ b/plugin.image.500px/resources/lib/fivehundredpxutils/xbmc.py
@@ -6,8 +6,10 @@ import urlparse
import xbmcgui
import xbmcplugin
+import xbmcaddon
-addon_path = os.getcwd()
+__addon__ = xbmcaddon.Addon()
+addon_path = __addon__.getAddonInfo('path')
addon_url = sys.argv[0]
addon_handle = int(sys.argv[1])
addon_params = dict(urlparse.parse_qsl(sys.argv[2][1:]))
@@ -34,7 +36,14 @@ def add_dir(name, url):
def add_image(image):
item = xbmcgui.ListItem(image.name, thumbnailImage=image.thumb_url)
+
+ if not 'ctxsearch' in addon_params:
+ label = "More from %s" % image.userfullname # i18n
+ url = encode_child_url('search', term=image.userid, ctxsearch=True)
+ action = "XBMC.Container.Update(%s)" % url
+ item.addContextMenuItems([(label, action,)])
+
xbmcplugin.addDirectoryItem(addon_handle, image.url, item)
def end_of_directory():
- xbmcplugin.endOfDirectory(addon_handle)
\ No newline at end of file
+ xbmcplugin.endOfDirectory(addon_handle)
http://xbmc.git.sourceforge.net/git/gitweb.cgi?p=xbmc/plugins;a=commit;h=987f5b914bf117c9ce0ec14ee9d0f6fe1c0c24ea
-----------------------------------------------------------------------
Summary of changes:
plugin.image.500px/addon.xml | 9 +-
plugin.image.500px/changelog.txt | 2 +
plugin.image.500px/default.py | 32 +++-
.../resources/lib/fivehundredpxutils/__init__.py | 3 +-
.../resources/lib/fivehundredpxutils/xbmc.py | 13 ++-
.../LICENSE.txt | 0
plugin.video.metv/README.txt | 8 +
plugin.video.metv/addon.xml | 25 +++
plugin.video.metv/changelog.txt | 3 +
plugin.video.metv/default.py | 182 ++++++++++++++++++++
plugin.video.metv/fanart.jpg | Bin 0 -> 247531 bytes
plugin.video.metv/icon.png | Bin 0 -> 96561 bytes
.../resources/language/English/strings.xml | 3 +
.../resources/settings.xml | 0
14 files changed, 267 insertions(+), 13 deletions(-)
copy {plugin.audio.abradio.cz => plugin.video.metv}/LICENSE.txt (100%)
create mode 100644 plugin.video.metv/README.txt
create mode 100644 plugin.video.metv/addon.xml
create mode 100644 plugin.video.metv/changelog.txt
create mode 100644 plugin.video.metv/default.py
create mode 100644 plugin.video.metv/fanart.jpg
create mode 100644 plugin.video.metv/icon.png
create mode 100644 plugin.video.metv/resources/language/English/strings.xml
copy {plugin.video.i24News => plugin.video.metv}/resources/settings.xml (100%)
hooks/post-receive
--
Plugins
------------------------------------------------------------------------------
Start Your Social Network Today - Download eXo Platform
Build your Enterprise Intranet with eXo Platform Software
Java Based Open Source Intranet - Social, Extensible, Cloud Ready
Get Started Now And Turn Your Intranet Into A Collaboration Platform
http://p.sf.net/sfu/ExoPlatform
_______________________________________________
Xbmc-addons mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/xbmc-addons