The branch, frodo has been updated
       via  f6ee503ef86d3917ba1fa2b2f68a67e2105930d1 (commit)
      from  ddc416326d10a673ae3772e2aaf674b72f47afd0 (commit)

- Log -----------------------------------------------------------------
http://xbmc.git.sourceforge.net/git/gitweb.cgi?p=xbmc/plugins;a=commit;h=f6ee503ef86d3917ba1fa2b2f68a67e2105930d1

commit f6ee503ef86d3917ba1fa2b2f68a67e2105930d1
Author: Martijn Kaijser <[email protected]>
Date:   Tue Oct 15 10:54:53 2013 +0200

    [plugin.video.jworg] 0.2.1

diff --git a/plugin.video.jworg/README.md b/plugin.video.jworg/README.md
index 0b04ec5..d15acf8 100644
--- a/plugin.video.jworg/README.md
+++ b/plugin.video.jworg/README.md
@@ -1,56 +1,5 @@
-plugin.video.jworg for XBMC
-===========================
+<h2>Visit the 
 
-A simple plugin to enjoy audio, music, and other contents from official 
Jehovah's Witnesses website (http://www.jw.org). 
-
-### Language support
-
-+ Italian
-+ English
-
-### Disclaimer
-
-This plugin don't break any copyright, because it's simply a different kind of 
browser. 
-Contents are read from web pages, 
-and then served to user, like your Firefox, Safari or mobile Browser.
-Only exception is background image: it cannot be dinamically loaded, so it's 
cached.
-
-### Install: 
-
-This addon is now part of official repository. Use the addon browser to search 
jw.org browser directly from your 
-  xbmc installation menu
-* *Latest version* on addon repository is 0.1.0. 
-* The v0.2.0 is actually on development status, so probably not 100% working, 
also, could be some new feature 
-will be developed before another release candidate is out. To install latest 
dev version, download 
-the [master zip 
file](https://github.com/realtebo/plugin.video.jworg/archive/master.zip) 
-and the use the function "Install from zip file" from system -> setting -> 
addon
-
-### Screenshot
-
-![Cover](/_screenshot/01%20-%20cover.PNG)
-![Video Filter](_screenshot/02 - video filter.PNG)
-![Video index](_screenshot/03 - video index.PNG)
-![Audio magazines](_screenshot/11%20-%20audio%20magazine.PNG))
-![Audio bible chapters](_screenshot/06%20-%20audio%20bible%20chapters.PNG)
-![Musics and 
sonds](_screenshot/07%20-%20audio%20musics%20and%20songs%20index.PNG)
-![Dramas](_screenshot/09%20-%20audio%20dramas%20index.PNG)
-![Daily text](_screenshot/08%20-%20daily%20text.PNG)
-![Settings](/_screenshot/10%20-%20settings.PNG)
-
-### Bug ? Ideas ? Complains ?
-
-Feel free to [open a new 
issue](https://github.com/realtebo/plugin.video.jworg/issues). Please refer 
*every time* to your specific version of the addon, and include eventually the 
step to reproduce a bug.
-
-### Do you want to help me with new languages ?
-
-Feel free to fork the project FROM MASTER BRANCH and create new strings.xml 
file for your language, then send a pull request. 
-
-### Tested platforms
-
-* Windows 8 Pro 64bit
-* Linux Mint 12-14
-* Raspberry PI 
-* Android 4.22
-
-All of these have Frodo "12.2" version of XBMC
+<a href="http://realtebo.github.io/plugin.video.jworg";>project website</a>
 
+to get more info</H2>
diff --git a/plugin.video.jworg/addon.py b/plugin.video.jworg/addon.py
index 1c5122d..1cf112d 100644
--- a/plugin.video.jworg/addon.py
+++ b/plugin.video.jworg/addon.py
@@ -17,6 +17,7 @@ from audio import jw_audio_magazine
 
 from program import jw_exec_index
 from program import jw_exec_daily_text
+from program import jw_exec_news
 
 """
 START
@@ -101,10 +102,18 @@ if content_type == "audio" :
                json_url = params["json_url"][0]
                jw_audio.showAudioJson(json_url);               
 
+
 if content_type == "executable" :
        if mode is None : 
                jw_exec_index.showExecIndex();
 
        if mode == "open_daily_text" : 
                date = params["date"][0]
-               jw_exec_daily_text.showDailyText(date); 
\ No newline at end of file
+               jw_exec_daily_text.showDailyText(date); 
+
+       if mode == "open_news_index" :
+               jw_exec_news.showNewsIndex();
+
+       if mode == "open_news_page" :
+               url = params["url"][0]
+               jw_exec_news.showNewsPage(url);
\ No newline at end of file
diff --git a/plugin.video.jworg/addon.xml b/plugin.video.jworg/addon.xml
index a06da91..66fcd84 100644
--- a/plugin.video.jworg/addon.xml
+++ b/plugin.video.jworg/addon.xml
@@ -2,7 +2,7 @@
 <addon 
     id="plugin.video.jworg" 
     name="Jw.org audio/video browser" 
-    version="0.2.0" 
+    version="0.2.1" 
     provider-name="Realtebo">
     <requires>
         <import addon="xbmc.python" version="2.1.0"/>
@@ -12,25 +12,26 @@
         <provides>audio video executable</provides>
     </extension>
     <extension point="xbmc.addon.metadata">
-        <language />
-        <platform>all</platform>
-        <website>https://github.com/realtebo/plugin.video.jworg</website>
+        <summary lang="de">Ein einfacher Browser für jw.org 
Medieninhalte</summary>
+        <summary lang="en">A simple browser for jw.org media content</summary>
+        <summary lang="es">Un navegador simple para jw.org contenido de 
medios</summary>
+        <summary lang="it">Un semplice browser per i contenuti di 
jw.org</summary>
+        <summary lang="nl">Een simpele browser voor JW.org 
media-inhoud</summary>
+        <summary lang="pl">Prosta przeglądarka treści medialnych serwisu 
jw.org</summary>
+        <summary lang="pt">Um navegador simples para o conteúdo de média em 
jw.org</summary>
+        <description lang="de">Mit direktes Streaming von www.jw.org, ist 
folgendes möglich:[CR]- Videos anschauen[CR]- Magazine, Lieder und Melodien 
aus dem Königreich, Bibellesungen, Audio Dramen und dramatische 
Bibellesungen[CR]- den Täglichen Text lesen </description>
+        <description lang="en">Directly streaming from www.jw.org, you 
can:[CR]- watch videos[CR]- listen magazine readings, songs and kingdom 
melodies, bible reading, audio dramas and dramatic bible readings[CR]- Read the 
daily text and news</description>
+        <description lang="es">Directamente fluye de www.jw.org, puede: [CR] - 
ver vídeos [CR] - escuchar lecturas de revistas, canciones y melodías reino, 
lectura de la Biblia, los dramas de audio y lecturas bíblicas dramáticas [CR] 
- Lee el texto diario y noticias</description>
+        <description lang="it">Direttamente in streaming da www.jw.org, è 
possibile:[CR]- guardare edificanti video[CR]- ascoltare la lettura delle 
riviste, cantici e melodie del regno, la lettura della Bibbia, i drammi audio 
ed i brani biblici recitati[CR]- leggere la scrittura del giorno e le 
news</description>
+        <description lang="nl">Directe streaming van www.jw.org, je kan:[CR]- 
Video`s bekijken[CR]- naar tijdschriftlezingen, Liedjes en volksliederen, 
Bijbellezingen, audio drama`s en dramatische Bijbellezingen luisteren[CR]- lees 
het dagelijkse citaat uit de bijbel en nieuws</description>
+        <description lang="pl">Przeglądaj internetową bibliotekę 
multimedialną serwisu www.jw.org.[CR] - Oglądaj filmy[CR] - Słuchaj melodii, 
słuchowisk, adaptacji dźwiękowych Biblii, czytaj Biblie[CR] - Przeczytaj 
słowo na dziś i nowości </description>
+        <description lang="pt">Transmissões de www.jw.org, você 
poderá:[CR]- ver vídeos[CR]- escutar leituras de magazine, músicas e 
canções, leituras da bíblia, dramatizações áudio e dramatizações de 
leituras da bíblia[CR]- Ler texto diário</description>
+        <language>it en pl nl es pt</language>
+        <platform />
+        <website>http://realtebo.github.io/plugin.video.jworg/</website>
         <source>https://github.com/realtebo/plugin.video.jworg</source>
         <license>GNU GENERAL PUBLIC LICENSE. Version 2, June 1991</license>
         <email></email>
         <forum></forum>
-        <summary lang="it">
-            Un semplice browser per i contenuti di jw.org
-        </summary>
-        <summary lang="en">
-            A simple browser for jw.org media content
-        </summary>
-        <description lang="it">
-            Direttamente in streaming da www.jw.org, è possibile:[CR]- 
guardare edificanti video[CR]- ascoltare la lettura delle riviste, cantici e 
melodie del regno, la lettura della Bibbia, i drammi audio ed i brani biblici 
recitati[CR]- leggere la scrittura del giorno
-        </description>
-        <description lang="en">
-            Directly streaming from www.jw.org, you can:[CR]- watch 
videos[CR]- listen magazine readings, songs and kingdom melodies, bible 
reading, audio dramas and dramatic bible readings[CR]- Read the daily text
-        </description>
     </extension>
 </addon>
-
diff --git a/plugin.video.jworg/audio/jw_audio.py 
b/plugin.video.jworg/audio/jw_audio.py
index 1ba5d71..58397ad 100644
--- a/plugin.video.jworg/audio/jw_audio.py
+++ b/plugin.video.jworg/audio/jw_audio.py
@@ -11,11 +11,10 @@ def showAudioIndex():
     
     items = [
         {"title" : jw_common.t(30010),  "mode"  : "open_bible_index",          
  "start" : None },
+        {"title" : jw_common.t(30025),  "mode"  : "open_magazine_index",       
  "start" : None },
         {"title" : jw_common.t(30011),  "mode"  : "open_music_index",          
  "start" : 0 },
         {"title" : jw_common.t(30013),  "mode"  : "open_drama_index",          
  "start" : 0 },
         {"title" : jw_common.t(30014),  "mode"  : 
"open_dramatic_reading_index", "start" : 0 },
-        {"title" : jw_common.t(30025),  "mode"  : "open_magazine_index",       
  "start" : None },
-
     ]
 
     for item in items:
diff --git a/plugin.video.jworg/audio/jw_audio_drama.py 
b/plugin.video.jworg/audio/jw_audio_drama.py
index f5f9676..c6f44ec 100644
--- a/plugin.video.jworg/audio/jw_audio_drama.py
+++ b/plugin.video.jworg/audio/jw_audio_drama.py
@@ -33,8 +33,11 @@ def showDramaIndex(start):
 
        drama_num = 0
        for drama in drama_titles:
+
+               title = jw_common.cleanUpText(drama_titles[drama_num])
+
                listItem = xbmcgui.ListItem(
-                       label                   = drama_titles[drama_num],
+                       label                   = title,
                        thumbnailImage  = drama_thumb[drama_num]
                )       
                params = {
diff --git a/plugin.video.jworg/audio/jw_audio_magazine.py 
b/plugin.video.jworg/audio/jw_audio_magazine.py
index 0249ee4..7c1037c 100644
--- a/plugin.video.jworg/audio/jw_audio_magazine.py
+++ b/plugin.video.jworg/audio/jw_audio_magazine.py
@@ -8,8 +8,6 @@ import re
 import xbmcgui
 import xbmcplugin
 
-print sys.argv
-
 def showMagazineFilterIndex(pub_filter = None):
 
     if pub_filter is None:
@@ -34,13 +32,17 @@ def showMagazineFilterIndex(pub_filter = None):
                 "mode"  : "open_magazine_index",       
                 "pub_filter" : "w"  ,
                 "year_filter" : "",
-            },
-            {   "title" : jw_common.t(30030),  
+            }
+        ]
+
+        # Support for simpliefied study edition of watchtower [english, 
spanish, ...]
+        language = jw_config.language
+        if jw_config.const[language]["has_simplified_edition"] == True :
+            items.append ({   "title" : jw_common.t(30030),  
                 "mode"  : "open_magazine_index",    
                 "pub_filter" : "ws" ,
                 "year_filter" : "",
-            },
-        ]
+            })
 
     if pub_filter is not None :
 
@@ -101,6 +103,22 @@ def showMagazineFilteredIndex(pub_filter = None, 
year_filter = None):
     regexp_cover = 
"data-img-size-md='(http://assets.jw.org/assets/[^.]+md\.jpg)'"
     cover = re.findall(regexp_cover, html)
 
+    # publication dates where
+    # pub_dates[0] = publication (w,wp, ws, g)
+    # pub_dates[1] = issue date (201301, 2013015, etc.. different by 
publication type)
+    regexp_pub_date = '"toc-([wgps]+)([0-9]+)"'
+    pub_dates = re.findall(regexp_pub_date, html)
+
+    cover_available = {}
+
+    # I create a dict of "pub_date : cover_url"
+    # So i can test if a pub_date really has a cover_url
+    for cover_url in cover:
+        regexp_cover_date = "([wsgp]+)_[A-Z]+_([0-9]+).md.jpg"
+        dates = re.findall(regexp_cover_date, cover_url)
+        the_key = dates[0][0] + "-" + dates[0][1]
+        cover_available[the_key] = cover_url
+
     count = 0
     for issue in issues:
 
@@ -108,9 +126,19 @@ def showMagazineFilteredIndex(pub_filter = None, 
year_filter = None):
         if issue[2].strip() != "":
             title = title + " - " + issue[2]
 
+        # somethings like "wp-20131201" or "g-201401"
+        pub_date = pub_dates[count][0] + "-" + pub_dates[count][1]
+        # placeholder to use if the cover is missing
+        cover_url = 
"http://assets.jw.org/themes/content-theme/images/thumbProduct_placeholder.jpg";
+        try :
+            cover_url = cover_available[pub_date]
+        except:
+            # this exception happens when there is no cover, but only 
placeholder
+            pass
+
         listItem    = xbmcgui.ListItem( 
             label           = title,
-            thumbnailImage  = cover[count]
+            thumbnailImage  = cover_url
         )     
 
         params      = {
diff --git a/plugin.video.jworg/changelog.txt b/plugin.video.jworg/changelog.txt
index 29623b9..4153f69 100644
--- a/plugin.video.jworg/changelog.txt
+++ b/plugin.video.jworg/changelog.txt
@@ -1,12 +1,34 @@
+0.2.1
+-----
+
+Small enhancements:
++ Changed order in index, to reflect jw.org item order (magazines now is after 
bible)
+
+New language supported (not 100% translated in some cases):
++ Dutch ("Nederlands")
++ Polish ("Polski")
++ Spanish ("Español")
++ German ("Deutsch")
++ Portuguese ("Português")
+
+Code
++ Changed detection of simplified edition of watchtower study edition 
++ Removed unused strings to translate
++ Enforced resistence to json loading errors
++ Enforced UTF-8 support
++ Enforced resistence to magazine page when missing cover images
++ Enforced drama title scraping
++ Switched to .po for mainstream (English) language and italian
+
 0.2.0
 -----
 
-New audio Feature
+New audio feature
 + Listen to magazine readings (even in simplified english !), with list 
filtering options as jw.org. Due to jw.org inconsistency, only magazine since 
January 2012 are supported
 + Listen to audio dramas
 + Listen to dramatic bible reading
 
-New program Features
+New program features
 + Read daily text [Issue #2]
 
 New settings
diff --git a/plugin.video.jworg/jw_common.py b/plugin.video.jworg/jw_common.py
index 17d97db..1d6cfa3 100644
--- a/plugin.video.jworg/jw_common.py
+++ b/plugin.video.jworg/jw_common.py
@@ -22,6 +22,7 @@ def cleanUpText(text):
        text = text.replace("&#039;", "'")
        text = text.replace("&quot;", '"')
        text = text.replace("&nbsp;", ' ')
+       text = text.strip()
        return text
 
 
@@ -72,11 +73,15 @@ def loadNotCachedUrl(url):
        return html             
 
 def loadUrl (url):
-       html = jw_config.cache.cacheFunction(loadNotCachedUrl, url)
+       html = ""
+       try :
+               html = jw_config.cache.cacheFunction(loadNotCachedUrl, url)
+       except:
+               pass 
        return html     
 
 def loadNotCachedJsonFromUrl(url):
-       data = None
+       data = ""
        try:
                response = urllib2.urlopen(url)
                data = json.load(response)
diff --git a/plugin.video.jworg/jw_config.py b/plugin.video.jworg/jw_config.py
index 3f1e397..20afa2b 100644
--- a/plugin.video.jworg/jw_config.py
+++ b/plugin.video.jworg/jw_config.py
@@ -1,3 +1,5 @@
+# -*- coding: UTF-8 -*-
+
 import xbmc
 import xbmcgui
 import xbmcplugin
@@ -8,57 +10,177 @@ import os
 
 import jw_common
 
-
-plugin_name    = sys.argv[0]   # plugin://plugin.video.jworg/
-pluginPid      = int(sys.argv[1])
-plugin_params  = urlparse.parse_qs((sys.argv[2])[1:])
-skin_used              = xbmc.getSkinDir()
-dir_media              = os.path.dirname(__file__) + os.sep + "resources" + 
os.sep + "media" + os.sep
-language       = xbmcplugin.getSetting(pluginPid, "language")
-if language == "":
-       language = jw_common.t(30009)
-
-try: 
-       emulating = xbmcgui.Emulating
-except: 
-       emulating = False
-
-try:
-       import StorageServer
-except:
-       from resources.lib import storageserverdummy as StorageServer
-        
-cache                  = StorageServer.StorageServer(plugin_name, 24)  # 2 
hour cache
-audio_sorting  = str(int(xbmcplugin.getSetting(pluginPid, "audio_sorting")) + 
1)
-video_sorting  = str(int(xbmcplugin.getSetting(pluginPid, "video_sorting")) + 
1)
-
+# key is english name, value is the name of the locale IN the locale
+locale_2_lang = {
+       "Italian"               : "Italiano",
+       "Polish"                : "Polski",
+       "Dutch"                 : "Nederlands",
+       "Spanish"               : "Español",
+       "German"                : "Deutsch",
+       "Portuguese"    : "Português",
+}
 
 const = {
        "Italiano"      : {
-               "video_path"                            : 
"http://www.jw.org/it/video";,
                "lang_code"                                     : "I",
+               "video_path"                            : 
"http://www.jw.org/it/video";,
+               
                "bible_index_audio"                     : 
"http://www.jw.org/it/pubblicazioni/bibbia/nwt/libri/";,
                "bible_audio_json"              : 
"http://www.jw.org/apps/I_TRGCHlZRQVNYVrXF?output=json&pub=bi12&fileformat=MP3&alllangs=0&langwritten=I";,
-               'daily_text_json'                       : 
"http://wol.jw.org/wol/dt/r6/lp-i";,
+               
+               "magazine_index"                        : 
"http://www.jw.org/it/pubblicazioni/riviste/";,
+               'has_simplified_edition'        : False,
+
                "music_index"                           : 
"http://www.jw.org/it/pubblicazioni/musica-cantici/";,
                "dramas_index"                          : 
"http://www.jw.org/it/pubblicazioni/drammi-biblici-audio/";,
                "dramatic_reading_index"        : 
"http://www.jw.org/it/pubblicazioni/brani-biblici-recitati/";,
-               "date_format"                           : "%d-%m-%Y",
-               "magazine_index"                        : 
"http://www.jw.org/it/pubblicazioni/riviste/";,
+               
+               'daily_text_json'                       : 
"http://wol.jw.org/wol/dt/r6/lp-i";,
+               "date_format"                           : "%d/%m/%Y",
+               "news_index"                            : 
"http://www.jw.org/it/news/";,
+
        },
        "English"       : {
-               "video_path"                            : 
"http://www.jw.org/en/videos";,
                "lang_code"                                     : "E",
+               "video_path"                            : 
"http://www.jw.org/en/videos";,
+               
                "bible_index_audio"                     : 
"http://www.jw.org/en/publications/bible/nwt/books/"; ,
                "bible_audio_json"              : 
"http://www.jw.org/apps/E_TRGCHlZRQVNYVrXF?output=json&pub=bi12&fileformat=MP3&alllangs=0&langwritten=E";,
-               'daily_text_json'                       : 
"http://wol.jw.org/wol/dt/r1/lp-e";,
+               
+               "magazine_index"                        : 
"http://www.jw.org/en/publications/magazines/";,
+               'has_simplified_edition'        : True,
+
                "music_index"                           : 
"http://www.jw.org/en/publications/music-songs/";,
                "dramas_index"                          : 
"http://www.jw.org/en/publications/audio-bible-dramas/";,
                "dramatic_reading_index"        : 
"http://www.jw.org/en/publications/dramatic-bible-readings/";,
+
+               'daily_text_json'                       : 
"http://wol.jw.org/wol/dt/r1/lp-e";,
                "date_format"                           : "%Y-%m-%d",
-               "magazine_index"                        : 
"http://www.jw.org/en/publications/magazines/";,
+               "news_index"                            : 
"http://www.jw.org/en/news/";,
        },
+       "Polski"        : {
+               "lang_code"                                     : "P",
+               "video_path"                            : 
"http://www.jw.org/pl/filmy/";,
+               
+               "bible_index_audio"                     : 
"http://www.jw.org/pl/publikacje/biblia/nwt/ksi%C4%99gi-biblijne/"; , 
+               "bible_audio_json"              : 
"http://www.jw.org/apps/TRGCHlZRQVNYVrXF?output=json&pub=bi12&fileformat=MP3&alllangs=0&langwritten=P&txtCMSLang=P";,
+               
+               "magazine_index"                        : 
"http://www.jw.org/pl/publikacje/czasopisma/";,
+               'has_simplified_edition'        : False,
+
+               "music_index"                           : 
"http://www.jw.org/pl/publikacje/muzyka-pie%C5%9Bni/";,
+               "dramas_index"                          : 
"http://www.jw.org/pl/publikacje/s%C5%82uchowiska-biblijne/";,
+               "dramatic_reading_index"        : 
"http://www.jw.org/pl/publikacje/adaptacje-d%C5%BAwi%C4%99kowe-biblii/";,
+               
+               'daily_text_json'                       : 
"http://wol.jw.org/wol/dt/r12/lp-p";,
+               "date_format"                           : "%d-%m-%Y",
+               "news_index"                            : 
"http://www.jw.org/pl/wiadomo%C5%9Bci/";
+       },      
+       "Nederlands" : {
+               "lang_code"                                     : "O",
+               "video_path"                            : 
"http://www.jw.org/nl/videos/";,
+
+               "bible_index_audio"                     : 
"http://www.jw.org/nl/publicaties/bijbel/nwt/boeken/"; , 
+               "bible_audio_json"              : 
"http://www.jw.org/apps/TRGCHlZRQVNYVrXF?output=json&pub=bi12&fileformat=MP3&alllangs=0&langwritten=O&txtCMSLang=O";,
 #last 2 are letters 'o' not zero
+               
+               "magazine_index"                        : 
"http://www.jw.org/nl/publicaties/tijdschriften/";,
+               'has_simplified_edition'        : False,
+
+               "music_index"                           : 
"http://www.jw.org/nl/publicaties/muziek-liederen/";,
+               "dramas_index"                          : 
"http://www.jw.org/nl/publicaties/audio-bijbel-dramas/";,
+               "dramatic_reading_index"        : 
"http://www.jw.org/nl/publicaties/bijbelse-hoorspelen/";,
+               
+               'daily_text_json'                       : 
"http://wol.jw.org/wol/dt/r18/lp-o";,
+               "date_format"                           : "%d-%m-%Y",
+               "news_index"                            : 
"http://www.jw.org/nl/nieuws/";
+       },      
+       "Español" : {
+               "lang_code"                                     : "S",
+               "video_path"                            : 
"http://www.jw.org/es/videos/";,
+
+               "bible_index_audio"                     : 
"http://www.jw.org/es/publicaciones/biblia/nwt/libros/"; , 
+               "bible_audio_json"              : 
"http://www.jw.org/apps/TRGCHlZRQVNYVrXF?output=json&pub=bi12&fileformat=MP3&alllangs=0&langwritten=S&txtCMSLang=S";,
+
+               "magazine_index"                        : 
"http://www.jw.org/es/publicaciones/revistas/";,
+               'has_simplified_edition'        : True,
+
+               "music_index"                           : 
"http://www.jw.org/es/publicaciones/m%C3%BAsica-c%C3%A1nticos/";,
+               "dramas_index"                          : 
"http://www.jw.org/es/publicaciones/audio-representaciones-dram%C3%A1ticas/";,
+               "dramatic_reading_index"        : 
"http://www.jw.org/es/publicaciones/lecturas-b%C3%ADblicas-dramatizadas/";,
+               
+               'daily_text_json'                       : 
"http://wol.jw.org/wol/dt/r4/lp-s";,
+               "date_format"                           : "%d-%m-%Y",
+               "news_index"                            : 
"http://www.jw.org/es/noticias/";
+       },      
+       "Deutsch" : {
+               "lang_code"                                     : "X",
+               "video_path"                            : 
"http://www.jw.org/de/videos/";,
+
+               "bible_index_audio"                     : 
"http://www.jw.org/de/publikationen/bibel/nwt/bibelbuecher/"; , 
+               "bible_audio_json"              : 
"http://www.jw.org/apps/TRGCHlZRQVNYVrXF?output=json&pub=bi12&fileformat=MP3&alllangs=0&langwritten=X&txtCMSLang=X";,
+
+               "magazine_index"                        : 
"http://www.jw.org/de/publikationen/zeitschriften/";,
+               'has_simplified_edition'        : False,
+
+               "music_index"                           : 
"http://www.jw.org/de/publikationen/musik-lieder/";,
+               "dramas_index"                          : 
"http://www.jw.org/de/publikationen/biblische-hoerspiele/";,
+               "dramatic_reading_index"        : 
"http://www.jw.org/de/publikationen/dramatische-bibellesungen/";,
+               
+               'daily_text_json'                       : 
"http://wol.jw.org/wol/dt/r10/lp-x";,
+               "date_format"                           : "%d-%m-%Y",
+               "news_index"                            : 
"http://www.jw.org/de/aktuelle-meldungen/";
+       },              
+       "Português" : {
+               "lang_code"                                     : "T",
+               "video_path"                            : 
"http://www.jw.org/pt/videos/";,
+
+               "bible_index_audio"                     : 
"http://www.jw.org/pt/publicacoes/biblia/nwt/livros/"; , 
+               "bible_audio_json"              : 
"http://www.jw.org/apps/TRGCHlZRQVNYVrXF?output=json&pub=bi12&fileformat=MP3&alllangs=0&langwritten=T&txtCMSLang=T";,
+
+               "magazine_index"                        : 
"http://www.jw.org/pt/publicacoes/revistas/";,
+               'has_simplified_edition'        : True,
+
+               "music_index"                           : 
"http://www.jw.org/pt/publicacoes/musica-canticos/";,
+               "dramas_index"                          : 
"http://www.jw.org/pt/publicacoes/dramas-biblicos-em-audio/";,
+               "dramatic_reading_index"        : 
"http://www.jw.org/pt/publicacoes/leituras-biblicas-dramatizadas/";,
+               
+               'daily_text_json'                       : 
"http://wol.jw.org/wol/dt/r5/lp-t";,
+               "date_format"                           : "%d-%m-%Y",
+               "news_index"                            : 
"http://www.jw.org/pt/noticias/";
+       },              
 }
 
 
+plugin_name    = sys.argv[0]   # plugin://plugin.video.jworg/
+pluginPid      = int(sys.argv[1])
+plugin_params  = urlparse.parse_qs((sys.argv[2])[1:])
+skin_used              = xbmc.getSkinDir()
+dir_media              = os.path.dirname(__file__) + os.sep + "resources" + 
os.sep + "media" + os.sep
+
+try: 
+       emulating = xbmcgui.Emulating
+except: 
+       emulating = False
+
+try:
+       import StorageServer
+except:
+       from resources.lib import storageserverdummy as StorageServer
+        
+cache                  = StorageServer.StorageServer(plugin_name, 24)  # 2 
hour cache
+audio_sorting  = str(int(xbmcplugin.getSetting(pluginPid, "audio_sorting")) + 
1)
+video_sorting  = str(int(xbmcplugin.getSetting(pluginPid, "video_sorting")) + 
1)
+
+# if language is set, it used a localized language name, like "Italiano" or 
"Polski"
+language               = xbmcplugin.getSetting(pluginPid, "language")
 
+# if not set, language will be read from system, where it uses english 
language name
+# if it's one of supported language, I got localized name to adhere to addon 
language setting 
+# availables values ( Italiano, English, Polski, ... )
+
+if language == "":
+       actual_locale = xbmc.getLanguage()
+       if actual_locale in locale_2_lang :
+               language = locale_2_lang[actual_locale]
+       else :
+               language = "English"
diff --git a/plugin.video.jworg/program/jw_exec_daily_text.py 
b/plugin.video.jworg/program/jw_exec_daily_text.py
index 3d43c82..6320ef3 100644
--- a/plugin.video.jworg/program/jw_exec_daily_text.py
+++ b/plugin.video.jworg/program/jw_exec_daily_text.py
@@ -1,5 +1,5 @@
 """
-EXECUTABLE RELATED FUNCTIONS
+DAILY_TEXT RELATED FUNCTIONS
 """
 import xbmc
 import xbmcgui
@@ -34,12 +34,16 @@ class DailiyText(xbmcgui.WindowDialog):
 
     def customInit(self, text):
         
-        width = self.getWidth()
-        height = self.getHeight()
         border = 50; # px relative to 1280/720 fixed grid resolution
 
         # width is always 1280, height is always 720.
         # getWidth() and getHeight() instead read the REAL screen resolution
+        bg_image = jw_config.dir_media + "blank.png"
+        self.ctrlBackgound = xbmcgui.ControlImage(
+            0,0, 
+            1280, 720, 
+            bg_image
+        )
         self.ctrlDate= xbmcgui.ControlTextBox(
             border, 0, 
             1280 - border *2, 60, 
@@ -55,9 +59,6 @@ class DailiyText(xbmcgui.WindowDialog):
             1280 - border *2, 720 - 200, 
             'font30', "0xFF000000"
         )
-        bg_image = jw_config.dir_media + "blank.png"
-
-        self.ctrlBackgound = xbmcgui.ControlImage(0,0, 1280, 720, bg_image)
         
         self.addControl (self.ctrlBackgound)
         self.addControl (self.ctrlDate)
@@ -68,8 +69,11 @@ class DailiyText(xbmcgui.WindowDialog):
         self.ctrlScripture.setText( self.getScriptureLine(text) );
         self.ctrlComment.setText( self.getComment(text) );
 
+    #get actioncodes from 
https://github.com/xbmc/xbmc/blob/master/xbmc/guilib/Key.h
     def onAction(self, action):
+        #Every key will close the windo
         self.close()
+        return
 
     # Grep today's textual date
     def getDateLine(self, text):
diff --git a/plugin.video.jworg/program/jw_exec_index.py 
b/plugin.video.jworg/program/jw_exec_index.py
index 8502836..79f737b 100644
--- a/plugin.video.jworg/program/jw_exec_index.py
+++ b/plugin.video.jworg/program/jw_exec_index.py
@@ -31,4 +31,21 @@ def showExecIndex():
         isFolder    = True 
     )  
 
+    """
+    # 2. News
+    title           = jw_common.t(30032)  
+    listItem        = xbmcgui.ListItem( title )
+    params          = {
+        "content_type"  : "executable", 
+        "mode"          : "open_news_index",
+    } 
+    url = jw_config.plugin_name + '?' + urllib.urlencode(params)
+    xbmcplugin.addDirectoryItem(
+        handle      = jw_config.pluginPid, 
+        url         = url, 
+        listitem    = listItem, 
+        isFolder    = True
+    )  
+    """
+    
     xbmcplugin.endOfDirectory(handle=jw_config.pluginPid)
diff --git a/plugin.video.jworg/resources/settings.xml 
b/plugin.video.jworg/resources/settings.xml
index d17556f..dbe3d26 100644
--- a/plugin.video.jworg/resources/settings.xml
+++ b/plugin.video.jworg/resources/settings.xml
@@ -3,7 +3,7 @@
  
   <category label="30005">
 
-    <setting id="language" type="labelenum" label="30002" 
lvalues="30003|30004"  />
+    <setting id="language" type="labelenum" label="30002" 
values="English|Deutsch|Italiano|Nederlands|Polski|Português|Español"  />
  
     <setting label="30019" type="lsep"/>
        <setting id="video_sorting" type="enum" label="30020" 
lvalues="30016|30017" default="0" />
diff --git a/plugin.video.jworg/video/jw_video.py 
b/plugin.video.jworg/video/jw_video.py
index f695372..522049b 100644
--- a/plugin.video.jworg/video/jw_video.py
+++ b/plugin.video.jworg/video/jw_video.py
@@ -63,6 +63,11 @@ def showVideoIndex(start, video_filter):
        regexp_video_json = '.*[^"] data-jsonurl="([^"]+)".*'
        video_json = re.findall(regexp_video_json, html)
 
+       if video_json is None or video_json == [] :
+               string = jw_common.t(30033) + " "
+               xbmcgui.Dialog().ok("jworg browser", string)
+               return
+
        count = 0
        # Output video list 
        for title in videos:
@@ -100,8 +105,9 @@ def showVideoJsonUrl(json_url, thumb):
        json_url        = "http://www.jw.org"; + json_url
        json            = jw_common.loadJsonFromUrl(json_url)
 
-       if json is None :
-               string = jw_common.t(30008) + " "
+       # json equals to [] when a cached json was empty
+       if json is None or json == [] :
+               string = jw_common.t(30033) + " "
                xbmcgui.Dialog().ok("jworg browser", string)
                return
 
@@ -127,12 +133,17 @@ def showVideoJsonUrl(json_url, thumb):
                        type            = 'Video', 
                        infoLabels      = {'Title': mp4_title_cleaned}
                )
+               listItem.setProperty("IsPlayable","true")
+
                xbmcplugin.addDirectoryItem(
                        handle          = jw_config.pluginPid, 
                        url                     = url, 
                        listitem        = listItem, 
                        isFolder        = False 
                )  
+               
+               
+               # xbmcplugin.setResolvedUrl( handle=jw_config.pluginPid, 
succeeded=True, listitem=listItem)
 
        xbmcplugin.endOfDirectory(handle=jw_config.pluginPid)
 

-----------------------------------------------------------------------

Summary of changes:
 plugin.video.jworg/README.md                       |   57 +------
 plugin.video.jworg/addon.py                        |   11 +-
 plugin.video.jworg/addon.xml                       |   35 ++--
 plugin.video.jworg/audio/jw_audio.py               |    3 +-
 plugin.video.jworg/audio/jw_audio_drama.py         |    5 +-
 plugin.video.jworg/audio/jw_audio_magazine.py      |   42 ++++-
 plugin.video.jworg/changelog.txt                   |   26 +++-
 plugin.video.jworg/jw_common.py                    |    9 +-
 plugin.video.jworg/jw_config.py                    |  184 ++++++++++++++++----
 plugin.video.jworg/program/jw_exec_daily_text.py   |   16 +-
 plugin.video.jworg/program/jw_exec_index.py        |   17 ++
 plugin.video.jworg/program/jw_exec_news.py         |  146 ++++++++++++++++
 .../resources/language/Afrikaans/strings.po        |   37 ++++
 .../resources/language/Albanian/strings.po         |   33 ++++
 .../resources/language/Amharic/strings.po          |   33 ++++
 .../resources/language/Arabic/strings.po           |   37 ++++
 .../resources/language/Basque/strings.po           |   37 ++++
 .../resources/language/Belarusian/strings.po       |   41 +++++
 .../resources/language/Bosnian/strings.po          |   33 ++++
 .../resources/language/Bulgarian/strings.po        |   37 ++++
 .../resources/language/Catalan/strings.po          |   37 ++++
 .../resources/language/Chinese (Simple)/strings.po |   41 +++++
 .../language/Chinese (Traditional)/strings.po      |   37 ++++
 .../resources/language/Croatian/strings.po         |   41 +++++
 .../resources/language/Czech/strings.po            |   37 ++++
 .../resources/language/Danish/strings.po           |   37 ++++
 .../resources/language/Dutch/strings.po            |  125 +++++++++++++
 .../resources/language/English/strings.po          |  161 +++++++++++++++++
 .../resources/language/English/strings.xml         |   33 ----
 .../resources/language/Esperanto/strings.po        |   29 +++
 .../resources/language/Estonian/strings.po         |   37 ++++
 .../resources/language/Finnish/strings.po          |   37 ++++
 .../resources/language/French/strings.po           |   37 ++++
 .../resources/language/Galician/strings.po         |   41 +++++
 .../resources/language/German/strings.po           |  125 +++++++++++++
 .../resources/language/Greek/strings.po            |   65 +++++++
 .../language/Haitian (Haitian Creole)/strings.po   |   25 +++
 .../resources/language/Hebrew/strings.po           |   41 +++++
 .../language/Hindi (Devanagiri)/strings.po         |   29 +++
 .../resources/language/Hungarian/strings.po        |   37 ++++
 .../resources/language/Icelandic/strings.po        |   37 ++++
 .../resources/language/Indonesian/strings.po       |   33 ++++
 .../resources/language/Italian/strings.po          |  129 ++++++++++++++
 .../resources/language/Italian/strings.xml         |   33 ----
 .../resources/language/Japanese/strings.po         |   37 ++++
 .../resources/language/Korean/strings.po           |   37 ++++
 .../resources/language/Latvian/strings.po          |   25 +++
 .../resources/language/Lithuanian/strings.po       |   37 ++++
 .../resources/language/Macedonian/strings.po       |   37 ++++
 .../resources/language/Malay/strings.po            |   29 +++
 .../resources/language/Malayalam/strings.po        |   25 +++
 .../resources/language/Maltese/strings.po          |   29 +++
 .../resources/language/Norwegian/strings.po        |   37 ++++
 .../resources/language/Persian (Iran)/strings.po   |   29 +++
 .../resources/language/Persian/strings.po          |   29 +++
 .../resources/language/Polish/strings.po           |  125 +++++++++++++
 .../language/Portuguese (Brazil)/strings.po        |   41 +++++
 .../resources/language/Portuguese/strings.po       |  125 +++++++++++++
 .../resources/language/Romanian/strings.po         |   37 ++++
 .../resources/language/Russian/strings.po          |   37 ++++
 .../language/Serbian (Cyrillic)/strings.po         |   33 ++++
 .../resources/language/Serbian/strings.po          |   33 ++++
 .../resources/language/Slovak/strings.po           |   37 ++++
 .../resources/language/Slovenian/strings.po        |   37 ++++
 .../language/Spanish (Argentina)/strings.po        |   37 ++++
 .../resources/language/Spanish (Mexico)/strings.po |   37 ++++
 .../resources/language/Spanish/strings.po          |  125 +++++++++++++
 .../resources/language/Swedish/strings.po          |   41 +++++
 .../resources/language/Tamil (India)/strings.po    |   37 ++++
 .../resources/language/Thai/strings.po             |   37 ++++
 .../resources/language/Turkish/strings.po          |   37 ++++
 .../resources/language/Ukrainian/strings.po        |   37 ++++
 .../language/Vietnamese (Viet Nam)/strings.po      |   25 +++
 .../resources/language/Vietnamese/strings.po       |   37 ++++
 plugin.video.jworg/resources/settings.xml          |    2 +-
 plugin.video.jworg/video/jw_video.py               |   15 ++-
 76 files changed, 3254 insertions(+), 192 deletions(-)
 create mode 100644 plugin.video.jworg/program/jw_exec_news.py
 create mode 100644 plugin.video.jworg/resources/language/Afrikaans/strings.po
 create mode 100644 plugin.video.jworg/resources/language/Albanian/strings.po
 create mode 100644 plugin.video.jworg/resources/language/Amharic/strings.po
 create mode 100644 plugin.video.jworg/resources/language/Arabic/strings.po
 create mode 100644 plugin.video.jworg/resources/language/Basque/strings.po
 create mode 100644 plugin.video.jworg/resources/language/Belarusian/strings.po
 create mode 100644 plugin.video.jworg/resources/language/Bosnian/strings.po
 create mode 100644 plugin.video.jworg/resources/language/Bulgarian/strings.po
 create mode 100644 plugin.video.jworg/resources/language/Catalan/strings.po
 create mode 100644 plugin.video.jworg/resources/language/Chinese 
(Simple)/strings.po
 create mode 100644 plugin.video.jworg/resources/language/Chinese 
(Traditional)/strings.po
 create mode 100644 plugin.video.jworg/resources/language/Croatian/strings.po
 create mode 100644 plugin.video.jworg/resources/language/Czech/strings.po
 create mode 100644 plugin.video.jworg/resources/language/Danish/strings.po
 create mode 100644 plugin.video.jworg/resources/language/Dutch/strings.po
 create mode 100644 plugin.video.jworg/resources/language/English/strings.po
 delete mode 100644 plugin.video.jworg/resources/language/English/strings.xml
 create mode 100644 plugin.video.jworg/resources/language/Esperanto/strings.po
 create mode 100644 plugin.video.jworg/resources/language/Estonian/strings.po
 create mode 100644 plugin.video.jworg/resources/language/Finnish/strings.po
 create mode 100644 plugin.video.jworg/resources/language/French/strings.po
 create mode 100644 plugin.video.jworg/resources/language/Galician/strings.po
 create mode 100644 plugin.video.jworg/resources/language/German/strings.po
 create mode 100644 plugin.video.jworg/resources/language/Greek/strings.po
 create mode 100644 plugin.video.jworg/resources/language/Haitian (Haitian 
Creole)/strings.po
 create mode 100644 plugin.video.jworg/resources/language/Hebrew/strings.po
 create mode 100644 plugin.video.jworg/resources/language/Hindi 
(Devanagiri)/strings.po
 create mode 100644 plugin.video.jworg/resources/language/Hungarian/strings.po
 create mode 100644 plugin.video.jworg/resources/language/Icelandic/strings.po
 create mode 100644 plugin.video.jworg/resources/language/Indonesian/strings.po
 create mode 100644 plugin.video.jworg/resources/language/Italian/strings.po
 delete mode 100644 plugin.video.jworg/resources/language/Italian/strings.xml
 create mode 100644 plugin.video.jworg/resources/language/Japanese/strings.po
 create mode 100644 plugin.video.jworg/resources/language/Korean/strings.po
 create mode 100644 plugin.video.jworg/resources/language/Latvian/strings.po
 create mode 100644 plugin.video.jworg/resources/language/Lithuanian/strings.po
 create mode 100644 plugin.video.jworg/resources/language/Macedonian/strings.po
 create mode 100644 plugin.video.jworg/resources/language/Malay/strings.po
 create mode 100644 plugin.video.jworg/resources/language/Malayalam/strings.po
 create mode 100644 plugin.video.jworg/resources/language/Maltese/strings.po
 create mode 100644 plugin.video.jworg/resources/language/Norwegian/strings.po
 create mode 100644 plugin.video.jworg/resources/language/Persian 
(Iran)/strings.po
 create mode 100644 plugin.video.jworg/resources/language/Persian/strings.po
 create mode 100644 plugin.video.jworg/resources/language/Polish/strings.po
 create mode 100644 plugin.video.jworg/resources/language/Portuguese 
(Brazil)/strings.po
 create mode 100644 plugin.video.jworg/resources/language/Portuguese/strings.po
 create mode 100644 plugin.video.jworg/resources/language/Romanian/strings.po
 create mode 100644 plugin.video.jworg/resources/language/Russian/strings.po
 create mode 100644 plugin.video.jworg/resources/language/Serbian 
(Cyrillic)/strings.po
 create mode 100644 plugin.video.jworg/resources/language/Serbian/strings.po
 create mode 100644 plugin.video.jworg/resources/language/Slovak/strings.po
 create mode 100644 plugin.video.jworg/resources/language/Slovenian/strings.po
 create mode 100644 plugin.video.jworg/resources/language/Spanish 
(Argentina)/strings.po
 create mode 100644 plugin.video.jworg/resources/language/Spanish 
(Mexico)/strings.po
 create mode 100644 plugin.video.jworg/resources/language/Spanish/strings.po
 create mode 100644 plugin.video.jworg/resources/language/Swedish/strings.po
 create mode 100644 plugin.video.jworg/resources/language/Tamil 
(India)/strings.po
 create mode 100644 plugin.video.jworg/resources/language/Thai/strings.po
 create mode 100644 plugin.video.jworg/resources/language/Turkish/strings.po
 create mode 100644 plugin.video.jworg/resources/language/Ukrainian/strings.po
 create mode 100644 plugin.video.jworg/resources/language/Vietnamese (Viet 
Nam)/strings.po
 create mode 100644 plugin.video.jworg/resources/language/Vietnamese/strings.po


hooks/post-receive
-- 
Plugins

------------------------------------------------------------------------------
October Webinars: Code for Performance
Free Intel webinars can help you accelerate application performance.
Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most from 
the latest Intel processors and coprocessors. See abstracts and register >
http://pubads.g.doubleclick.net/gampad/clk?id=60135031&iu=/4140/ostg.clktrk
_______________________________________________
Xbmc-addons mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/xbmc-addons

Reply via email to