Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[plugin.video.tagesschau] 2.5.4 #4431

Merged
merged 1 commit into from
Dec 3, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion plugin.video.tagesschau/addon.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<addon
id="plugin.video.tagesschau"
version="2.5.3"
version="2.5.4"
name="Tagesschau"
provider-name="J.Schumacher, H.Saul, C.Prasch">
<requires>
Expand Down Expand Up @@ -31,6 +31,10 @@
<screenshot>resources/assets/screenshot_3.png</screenshot>
</assets>
<news>
version 2.5.4 (2023-12-03)
* Fixed content types so that skins use landscape viewtype
* Added setting to hide "Europadruck" and "Aktueller Wolkenfilm" from news list

version 2.5.3 (2023-05-24)
* Bugfixes
* Added setting for the tagesthemen listing: show broadcasts, topics or both
Expand Down
14 changes: 9 additions & 5 deletions plugin.video.tagesschau/libs/tagesschau.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,9 @@ def addVideoContentDirectory(title, method):
url_data = { ACTION_PARAM: 'list_feed', FEED_PARAM: method }
url = 'plugin://' + ADDON_ID + '/?' + urllib.parse.urlencode(url_data)
li = xbmcgui.ListItem(str(title))
li.setArt({'thumb':DEFAULT_IMAGE_URL})
li.setArt({'thumb':DEFAULT_IMAGE_URL, 'landscape':DEFAULT_IMAGE_URL})
li.setProperty('Fanart_Image', FANART)
xbmcplugin.setContent(int(sys.argv[1]), 'videos')
xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]), url=url, listitem=li, isFolder=True)

def getListItem(videocontent):
Expand All @@ -71,17 +72,18 @@ def getListItem(videocontent):
if(not image_url):
image_url = DEFAULT_IMAGE_URL
li = xbmcgui.ListItem(title)
li.setArt({'thumb':image_url})
li.setArt({'thumb':image_url, 'landscape':image_url})
li.setProperty('Fanart_Image', FANART)
li.setProperty('IsPlayable', 'true')
li.setInfo(type="Video",
li.setInfo(type="video",
infoLabels={ "Title": str(title),
"Plot": str(videocontent.description),
"Duration": str((videocontent.duration or 0)/60)
"Duration": str((videocontent.duration or 0)/60),
"mediatype": "video"
}
)
if( videocontent.timestamp ):
li.setInfo(type="Video",
li.setInfo(type="video",
infoLabels={ "premiered": str(videocontent.timestamp.strftime('%d.%m.%Y')),
"aired": str(videocontent.timestamp.strftime('%d.%m.%Y')),
"date": str(videocontent.timestamp.strftime('%d.%m.%Y'))
Expand All @@ -98,6 +100,7 @@ def getUrl(videocontent, method):
def addVideoContentItem(videocontent, method):
li = getListItem(videocontent)
url = getUrl(videocontent, method)
xbmcplugin.setContent(int(sys.argv[1]), 'videos')
return xbmcplugin.addDirectoryItem(int(sys.argv[1]), url, li, False)

def addVideoContentItems(videocontents, method):
Expand All @@ -107,6 +110,7 @@ def addVideoContentItems(videocontents, method):
li = getListItem(videocontent)
url = getUrl(videocontent, method)
items.append((url, li, False))
xbmcplugin.setContent(int(sys.argv[1]), 'videos')
return xbmcplugin.addDirectoryItems(int(sys.argv[1]), items, len(items))

def get_params():
Expand Down
12 changes: 10 additions & 2 deletions plugin.video.tagesschau/libs/tagesschau_json_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@
addon = xbmcaddon.Addon(id=ADDON_ID)
showage = addon.getSettingBool('ShowAge')
tt_listopt = addon.getSetting('tt_list')
hide_europadruck = addon.getSettingBool('hide_europadruck')
hide_wolkenfilm = addon.getSettingBool('hide_wolkenfilm')

class VideoContent(object):
"""Represents a single video or broadcast.
Expand Down Expand Up @@ -231,13 +233,19 @@ def latest_videos(self):
A list of VideoContent items.
"""
self._logger.info("retrieving videos")

videos = []
data = self._jsonsource.latest_videos()
for jsonvideo in data["news"]:
try:
if( (jsonvideo["type"] == "video") and (jsonvideo["tracking"][0]["src"] == "ard-aktuell") ):
video = self._parser.parse_video(jsonvideo)
videos.append(video)
if( hide_europadruck and ("Europadruck" in jsonvideo["title"]) ):
pass
elif( hide_wolkenfilm and ("Wolkenfilm" in jsonvideo["title"]) ):
pass
else:
video = self._parser.parse_video(jsonvideo)
videos.append(video)
except:
self._logger.info("ignoring")

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,14 @@ msgctxt "#30006"
msgid "Broadcasts and Topics"
msgstr "Sendungen und Beiträge"

msgctxt "#30007"
msgid "Hide \"Europadruck\" in news"
msgstr "Verstecke \"Europadruck\" in Nachrichten"

msgctxt "#30008"
msgid "Hide \"Aktueller Wolkenfilm\" in news"
msgstr "Verstecke \"Aktueller Wolkenfilm\" in Nachrichten"

msgctxt "#30100"
msgid "News"
msgstr "Nachrichten"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,14 @@ msgctxt "#30006"
msgid "Broadcasts and Topics"
msgstr ""

msgctxt "#30007"
msgid "Hide \"Europadruck\" in news"
msgstr ""

msgctxt "#30008"
msgid "Hide \"Aktueller Wolkenfilm\" in news"
msgstr ""

msgctxt "#30100"
msgid "News"
msgstr ""
Expand Down
2 changes: 2 additions & 0 deletions plugin.video.tagesschau/resources/settings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,6 @@
<setting id="quality" type="enum" label="30001" values="Small (480x272)|Medium (640x368)|Large (1280x720)" default="2" />
<setting id="ShowAge" type="bool" label="30002" default="true" />
<setting id="tt_list" type="enum" label="30003" lvalues="30004|30005|30006" default="2" />
<setting id="hide_europadruck" type="bool" label="30007" default="true" />
<setting id="hide_wolkenfilm" type="bool" label="30008" default="true" />
</settings>
Loading