]> git.webhop.me Git - bs-cst-neutrino-hd.git/commitdiff
- fix missing pictures; fix empty titles
authorJacek Jendrzej <overx300@gmail.com>
Fri, 14 Jun 2019 21:15:11 +0000 (23:15 +0200)
committerMarkham <markham001@gmx.de>
Fri, 14 Jun 2019 21:15:11 +0000 (23:15 +0200)
Signed-off-by: Markham <markham001@gmx.de>
archive-patches/lua-feedparser.patch [new file with mode: 0644]
make/libraries.mk

diff --git a/archive-patches/lua-feedparser.patch b/archive-patches/lua-feedparser.patch
new file mode 100644 (file)
index 0000000..7d22291
--- /dev/null
@@ -0,0 +1,38 @@
+commit 782e2925d376d4d78382faa4ef477c72de3d8848
+Author: Jacek Jendrzej <overx300@gmail.com>
+Date:   Fri Jun 14 08:45:41 2019 +0200
+
+    - fix missing pictures; fix empty titles
+
+diff --git a/feedparser.lua b/feedparser.lua
+index 2d66b8c..b3887ce 100644
+--- a/feedparser.lua
++++ b/feedparser.lua
+@@ -73,7 +73,17 @@ local function parse_entries(entries_el, format_str, base)
+                       --content
+                       elseif  (format_str=='atom' and tag=='content') or 
+                                       (format_str=='rss' and (tag=='body' or tag=='xhtml:body' or tag == 'fullitem' or tag=='content:encoded')) then 
+-                              entry.content=el:getText()                      
++                              entry.content=el:getText()
++                              if el.lom and el.lom[2] and el.lom[2][2] and el.lom[2][2][2].attr and el.lom[2][2][2].attr.src then
++                                      local img = el.lom[2][2][2].attr.src
++                                      if img:match ('(http.-%.jpg)') or img:match ('(http.-%.jpeg)') then
++                                              tinsert(entry.enclosures, {
++                                                      url=img,
++                                                      length=0,
++                                                      type="image/jpeg"
++                                              })
++                                      end
++                              end
+                               --TODO: content_detail
+                       
+                       --published
+@@ -317,7 +327,7 @@ local function parse_rss(root, base_uri)
+               --image
+               elseif tag=='image' or tag=='rdf:image' then
+                       feed.image={
+-                              title=el:getChild('title'):getText(),
++                              title=(el:getChild('title') or blanky):getText(),
+                               link=(el:getChild('link') or blanky):getText(),
+                               width=(el:getChild('width') or blanky):getText(),
+                               height=(el:getChild('height') or blanky):getText()
index db68e2d9ac80b0279841a53f3c647099cef9dccf..78d5c4a1f4ae94434c61819943df4940560b11f1 100755 (executable)
@@ -1008,6 +1008,7 @@ $(D)/lua-feedparser: $(ARCHIVE)/lua-feedparser-$(LUA_FEEDPARSER_VER).tar.bz2 $(D
        $(REMOVE)/lua-feedparser-$(LUA_FEEDPARSER_VER)
        $(UNTAR)/lua-feedparser-$(LUA_FEEDPARSER_VER).tar.bz2; \
        set -e; cd $(BUILD_TMP)/lua-feedparser-$(LUA_FEEDPARSER_VER); \
+               $(PATCH)/lua-feedparser.patch; \
                sed -i -e "s/^PREFIX.*//" -e "s/^LUA_DIR.*//" Makefile ; \
                $(BUILDENV) \
                make LUA_DIR=$(TARGETPREFIX)/share/lua/$(LUA_ABIVER) install ; \