forked from sch/Slixfeed
Fix media (i.e. enclosure) support (Thank you roughnecks).
This commit is contained in:
parent
b6ca4aaa46
commit
71403cda6b
3 changed files with 22 additions and 2 deletions
|
@ -310,6 +310,8 @@ async def xmpp_send_message(self, jid, num=None):
|
|||
summary = result[3]
|
||||
feed_id = result[4]
|
||||
date = result[5]
|
||||
enclosure = sqlite.get_enclosure_by_entry_id(db_file, ix)
|
||||
if enclosure: enclosure = enclosure[0]
|
||||
title_f = sqlite.get_feed_title(db_file, feed_id)
|
||||
title_f = title_f[0]
|
||||
news_digest += await list_unread_entries(self, result, title_f, jid)
|
||||
|
|
|
@ -1406,6 +1406,24 @@ def get_entries_rejected(db_file, num):
|
|||
return result
|
||||
|
||||
|
||||
def get_enclosure_by_entry_id(db_file, ix):
|
||||
function_name = sys._getframe().f_code.co_name
|
||||
logger.debug('{}: db_file: {} ix: {}'
|
||||
.format(function_name, db_file, ix))
|
||||
with create_connection(db_file) as conn:
|
||||
cur = conn.cursor()
|
||||
sql = (
|
||||
"""
|
||||
SELECT url
|
||||
FROM entries_properties_links
|
||||
WHERE entry_id = :ix AND rel = "enclosure"
|
||||
"""
|
||||
)
|
||||
par = (ix,)
|
||||
result = cur.execute(sql, par).fetchone()
|
||||
return result
|
||||
|
||||
|
||||
def get_unread_entries(db_file, num):
|
||||
"""
|
||||
Extract information from unread entries.
|
||||
|
|
|
@ -1,2 +1,2 @@
|
|||
__version__ = '0.1.54'
|
||||
__version_info__ = (0, 1, 54)
|
||||
__version__ = '0.1.55'
|
||||
__version_info__ = (0, 1, 55)
|
||||
|
|
Loading…
Reference in a new issue