The branch, frodo has been updated
via 1df6abd0b9236b81f1759cb598d86b157c5a4677 (commit)
from 6b00a354474cb060d444b7bdd1ff0a988fb77259 (commit)
- Log -----------------------------------------------------------------
http://xbmc.git.sourceforge.net/git/gitweb.cgi?p=xbmc/plugins;a=commit;h=1df6abd0b9236b81f1759cb598d86b157c5a4677
commit 1df6abd0b9236b81f1759cb598d86b157c5a4677
Author: beenje <[email protected]>
Date: Sun May 12 19:47:39 2013 +0200
[plugin.video.vgtv] updated to version 2.0.7
diff --git a/plugin.video.vgtv/addon.py b/plugin.video.vgtv/addon.py
index 96bd108..72e7459 100644
--- a/plugin.video.vgtv/addon.py
+++ b/plugin.video.vgtv/addon.py
@@ -17,18 +17,20 @@
# VGTV plugin for XBMC
import os
+from resources.lib.api import VgtvApi
from xbmcswift2 import ListItem
from xbmcswift2 import Plugin
-from resources.lib.api import VgtvApi
from xbmcswift2 import xbmcgui
+from xbmcswift2 import actions
STRINGS = {
- 'plugin_name': 30000,
- 'most_recent': 30001,
- 'most_viewed': 30002,
- 'search': 30003,
- 'previous_page': 30004,
- 'next_page': 30005,
+ 'plugin_name': 30000,
+ 'most_recent': 30001,
+ 'most_viewed': 30002,
+ 'search': 30003,
+ 'previous_page': 30004,
+ 'next_page': 30005,
+ 'remove_from_history': 30006
}
plugin = Plugin()
@@ -55,7 +57,11 @@ def index():
}, {
'label': _('search'),
'thumbnail': os.path.join(RES_PATH, 'search.png'),
- 'path': plugin.url_for('input_search')
+ 'path': plugin.url_for('show_search_history')
+ }, {
+ 'label': 'Level Up',
+ 'thumbnail': os.path.join(RES_PATH, 'level-up.png'),
+ 'path': plugin.url_for('show_category', id='147')
}]
plugin.add_items(items)
@@ -82,6 +88,39 @@ def show_most_seen(page):
return show_video_list('show_most_seen', items, page, last_page)
[email protected]('/searchhistory/')
+def show_search_history():
+ history = plugin.get_storage('search_history')
+ searches = history.get('items', [])
+
+ # If we have no items in the search history, open input
+ if (searches is None or len(searches) == 0):
+ return input_search()
+
+ # Always start with the "new search"-option
+ items = [{
+ 'label': _('search') + '...',
+ 'path': plugin.url_for('input_search'),
+ 'thumbnail': os.path.join(RES_PATH, 'search.png'),
+ }]
+
+ # Loop and add queries from history
+ for search in searches:
+ items.append({
+ 'label': search,
+ 'path': plugin.url_for('show_search', page='1', query=search),
+ 'thumbnail': os.path.join(RES_PATH, 'search.png'),
+ 'context_menu': [
+ make_remove_from_history_context_item(search)
+ ]
+ })
+
+ plugin.add_items(items)
+ return plugin.finish(
+ view_mode='thumbnail',
+ update_listing=False
+ )
+
@plugin.route('/search/')
def input_search():
query = plugin.keyboard(heading=_('search'))
@@ -89,6 +128,18 @@ def input_search():
if query is None or len(str(query)) == 0:
return
+ # Store search in history
+ history = plugin.get_storage('search_history')
+ searches = history.get('items', [])
+ searches.insert(0, query)
+
+ # Have we reached or history limit?
+ if len(searches) == 40:
+ searches.pop()
+
+ # Store the search history
+ history['items'] = searches
+
return show_search(1, query)
@@ -125,6 +176,15 @@ def play_url(url, category=None, id=None, title=None,
duration=None):
track_video_play(id, category, title, duration)
return plugin.set_resolved_url(url)
[email protected]('/searchhistory/remove/<query>')
+def remove_from_history(query):
+ history = plugin.get_storage('search_history')
+ searches = history.get('items', [])
+ searches.remove(query)
+ history['items'] = searches
+
+ return show_search_history()
+
def show_video_list(fn, items, page, last_page, query=''):
page = int(page)
@@ -163,6 +223,10 @@ def build_category_list(root_id=0):
return items
+def make_remove_from_history_context_item(query):
+ label = _('remove_from_history')
+ new_url = plugin.url_for('remove_from_history', query=query)
+ return (label, 'XBMC.Container.Refresh(%s)' % new_url)
# Call tracking
def track_video_play(id, category, title, duration):
diff --git a/plugin.video.vgtv/addon.xml b/plugin.video.vgtv/addon.xml
index 8e55768..4309bd5 100644
--- a/plugin.video.vgtv/addon.xml
+++ b/plugin.video.vgtv/addon.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
-<addon id="plugin.video.vgtv" name="VGTV" version="2.0.6" provider-name="Espen
Hovlandsdal">
+<addon id="plugin.video.vgtv" name="VGTV" version="2.0.7" provider-name="Espen
Hovlandsdal">
<requires>
<import addon="xbmc.python" version="2.1.0"/>
<import addon="script.module.xbmcswift2" version="1.1.1"/>
@@ -14,5 +14,9 @@
<summary>VGTV.no</summary>
<description>Enjoy videos from VGTV.no - News, sports and entertainment -
mainly Norwegian.</description>
<description lang="no">Se videoer fra VGTV.no - NettTV fra Verdens Gang
(VG).</description>
+ <license>GNU GENERAL PUBLIC LICENSE. Version 3, 29 June 2007</license>
+ <forum>http://forum.xbmc.org/showthread.php?tid=163526</forum>
+ <source>https://github.com/rexxars/vgtv-xbmc.git</source>
+ <email>[email protected]</email>
</extension>
</addon>
diff --git a/plugin.video.vgtv/changelog.txt b/plugin.video.vgtv/changelog.txt
index 5012351..c3a747c 100644
--- a/plugin.video.vgtv/changelog.txt
+++ b/plugin.video.vgtv/changelog.txt
@@ -1,3 +1,8 @@
+[B]2.0.7[/B]
+- Introduced search history functionality
+- Added durations for videos
+- Added a root-level "Level Up"-category
+
[B]2.0.6[/B]
- Fixed a bug where videos could not be played if category ID was defined
diff --git a/plugin.video.vgtv/resources/images/latest.png
b/plugin.video.vgtv/resources/images/latest.png
index a7c4f5e..e1dd5a9 100644
Binary files a/plugin.video.vgtv/resources/images/latest.png and
b/plugin.video.vgtv/resources/images/latest.png differ
diff --git a/plugin.video.vgtv/resources/language/English/strings.xml
b/plugin.video.vgtv/resources/language/English/strings.xml
index 6314cce..6b2dae6 100644
--- a/plugin.video.vgtv/resources/language/English/strings.xml
+++ b/plugin.video.vgtv/resources/language/English/strings.xml
@@ -12,4 +12,7 @@
<string id="30004">Previous page</string>
<string id="30005">Next page</string>
+ <!-- Search context -->
+ <string id="30006">Remove from history</string>
+
</strings>
\ No newline at end of file
diff --git a/plugin.video.vgtv/resources/language/Norwegian/strings.xml
b/plugin.video.vgtv/resources/language/Norwegian/strings.xml
index 1c4b89f..ca6af3d 100644
--- a/plugin.video.vgtv/resources/language/Norwegian/strings.xml
+++ b/plugin.video.vgtv/resources/language/Norwegian/strings.xml
@@ -12,4 +12,7 @@
<string id="30004">Forrige side</string>
<string id="30005">Neste side</string>
+ <!-- Search context -->
+ <string id="30006">Fjern fra historikk</string>
+
</strings>
\ No newline at end of file
diff --git a/plugin.video.vgtv/resources/lib/api.py
b/plugin.video.vgtv/resources/lib/api.py
index 8ceb2d9..230340f 100644
--- a/plugin.video.vgtv/resources/lib/api.py
+++ b/plugin.video.vgtv/resources/lib/api.py
@@ -23,7 +23,6 @@ import urllib2
import re
from utils import unescape
from datetime import datetime
-from datetime import timedelta
from urllib import urlencode
from random import random
@@ -111,6 +110,11 @@ class VgtvApi():
'aired': self.get_date(meta.get('timePublished')),
'duration': self.get_duration(meta.get('duration'))
},
+ 'stream_info': {
+ 'video': {
+ 'duration': meta.get('duration', 0)
+ }
+ },
'path': vid_url,
'is_playable': True,
})
@@ -210,7 +214,7 @@ class VgtvApi():
return datetime.fromtimestamp(timestamp).strftime('%Y-%m-%d')
def get_duration(self, secs):
- return timedelta(seconds=secs)
+ return str(secs / 60)
def track_play(self, id, category_id, title, resolution, duration):
category = self.get_category(category_id)
-----------------------------------------------------------------------
Summary of changes:
plugin.video.vgtv/addon.py | 80 ++++++++++++++++++--
plugin.video.vgtv/addon.xml | 6 +-
plugin.video.vgtv/changelog.txt | 5 +
plugin.video.vgtv/resources/images/latest.png | Bin 27454 -> 8461 bytes
plugin.video.vgtv/resources/images/level-up.png | Bin 0 -> 12087 bytes
.../resources/language/English/strings.xml | 3 +
.../resources/language/Norwegian/strings.xml | 3 +
plugin.video.vgtv/resources/lib/api.py | 8 ++-
8 files changed, 94 insertions(+), 11 deletions(-)
create mode 100644 plugin.video.vgtv/resources/images/level-up.png
hooks/post-receive
--
Plugins
------------------------------------------------------------------------------
Learn Graph Databases - Download FREE O'Reilly Book
"Graph Databases" is the definitive new guide to graph databases and
their applications. This 200-page book is written by three acclaimed
leaders in the field. The early access version is available now.
Download your free book today! http://p.sf.net/sfu/neotech_d2d_may
_______________________________________________
Xbmc-addons mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/xbmc-addons