Skip to content

Commit

Permalink
release: v1.49.0
Browse files Browse the repository at this point in the history
  • Loading branch information
newt-sc committed Aug 24, 2024
1 parent dc16e11 commit f6695d3
Show file tree
Hide file tree
Showing 10 changed files with 317 additions and 17 deletions.
2 changes: 1 addition & 1 deletion .githooks/pre-commit
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ addon=$(tail -n +2 addon.xml)

printf "$prefix\n$addon\n$suffix\n" > packages/addons.xml
cat packages/addons.xml | shasum | awk '{print $1}' > packages/addons.xml.crc
truncate --size -1 packages/addons.xml.crc
gtruncate --size -1 packages/addons.xml.crc

python ./scripts/update_changelog.py

Expand Down
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
* [v1.49.0](https://github.com/newt-sc/a4kStreaming/releases/tag/plugin.video.a4kstreaming%2Fplugin.video.a4kstreaming-1.49.0):
* Remove deprecated usages ListItem methods

* [v1.48.0](https://github.com/newt-sc/a4kStreaming/releases/tag/plugin.video.a4kstreaming%2Fplugin.video.a4kstreaming-1.48.0):
* Support KODI 20

Expand Down
25 changes: 13 additions & 12 deletions a4kStreaming/explorer.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ def __set_title_contextmenu(core, title, list_item):

if not tvseries:
if has_rating:
list_item.setInfo('video', {
core.kodi.set_info_tag(list_item, {
'overlay': 5,
'playcount': 1
})
Expand Down Expand Up @@ -247,7 +247,7 @@ def __add_seasons(core, title):
'episode': season.episodes,
'plot': title.get('plot', None)
}
list_item.setInfo('video', video_meta)
core.kodi.set_info_tag(list_item, video_meta)

url = '%s?action=query&type=episodes&id=%s&season=%s' % (core.url, title['id'], key)
if season.year:
Expand All @@ -266,7 +266,7 @@ def __add_seasons(core, title):
context_menu_items = []
last_episode_has_rating = season.last_episode and season.last_episode.get('userRating', None) is not None
if last_episode_has_rating:
list_item.setInfo('video', {
core.kodi.set_info_tag(list_item, {
'overlay': 5,
'playcount': 1
})
Expand Down Expand Up @@ -423,6 +423,7 @@ def __add_titles(core, titles, browse, silent=False):
continue

list_item = core.kodi.xbmcgui.ListItem(label=title['titleTextStyled'] if title.get('titleTextStyled', None) else title['titleText'], offscreen=True)
video_info_tag = list_item.getVideoInfoTag()

primary_image = title.get('primaryImage', None)
poster_image = title.get('poster', None)
Expand Down Expand Up @@ -481,7 +482,7 @@ def __add_titles(core, titles, browse, silent=False):
if title.get('ratingsSummary', None):
ratingsSummary = title['ratingsSummary']
if ratingsSummary.get('aggregateRating', None) and ratingsSummary.get('voteCount', None):
list_item.setRating("imdb", ratingsSummary['aggregateRating'], ratingsSummary['voteCount'], True)
video_info_tag.setRating(ratingsSummary['aggregateRating'], ratingsSummary['voteCount'], "imdb", True)

if title.get('episodes', None):
episodes = title['episodes']
Expand Down Expand Up @@ -534,7 +535,7 @@ def __add_titles(core, titles, browse, silent=False):
'writer': [item['nameText'] for item in writers] if isinstance(writers, list) else writers['nameText'],
})

list_item.setInfo('video', video_meta)
info_tag = core.kodi.set_info_tag(list_item, video_meta)

cast = []
if 'principalCredits' in title:
Expand All @@ -556,7 +557,7 @@ def __add_titles(core, titles, browse, silent=False):
'role': ' / '.join(characters) if characters else None,
'thumbnail': core.utils.fix_poster_size(member.get('primaryImage', member.get('name', {}).get('primaryImage', None)))
})
list_item.setCast(cast_meta)
info_tag.set_cast(cast_meta)

if titleType in ['movie', 'tvEpisode']:
if browse:
Expand Down Expand Up @@ -1036,7 +1037,7 @@ def cloud(core, params):
parsed_response = core.json.loads(response.content)
link = parsed_response['download']
item = core.kodi.xbmcgui.ListItem(path=link, offscreen=True)
item.setInfo('video', {'mediatype': 'video'})
core.kodi.set_info_tag(item, {'mediatype': 'video'})
core.utils.end_action(core, True, item)
return core.skip_end_of_dir

Expand Down Expand Up @@ -1129,7 +1130,7 @@ def cloud(core, params):

link = parsed_response.get('data', parsed_response)['link']
item = core.kodi.xbmcgui.ListItem(path=link, offscreen=True)
item.setInfo('video', {'mediatype': 'video'})
core.kodi.set_info_tag(item, {'mediatype': 'video'})
core.utils.end_action(core, True, item)
return core.skip_end_of_dir

Expand Down Expand Up @@ -1731,7 +1732,7 @@ def query(core, params):

if isinstance(data, dict) and (data.get('paginationToken', None) or data.get('pageInfo', None) and data['pageInfo'].get('hasNextPage', False)):
next_list_item = core.kodi.xbmcgui.ListItem(label='Next', offscreen=True)
next_list_item.setInfo('video', {'mediatype': 'video'})
core.kodi.set_info_tag(next_list_item, {'mediatype': 'video'})

paginationToken = data.get('paginationToken', None)
if not paginationToken:
Expand Down Expand Up @@ -2020,7 +2021,7 @@ def trailer(core, params):
return []

item = core.kodi.xbmcgui.ListItem(path=trailerUrl, offscreen=True)
item.setInfo('video', {'mediatype': 'video'})
core.kodi.set_info_tag(item, {'mediatype': 'video'})
if params.play == 'true':
core.kodi.close_busy_dialog()
core.kodi.xbmc.Player().play(item=trailerUrl, listitem=item)
Expand Down Expand Up @@ -2705,8 +2706,8 @@ def delete_magnet():
if provider_params.title.poster:
item.setArt({ 'poster': provider_params.title.poster })

item.setInfo('video', video_meta)
item.addStreamInfo('video', { 'codec': result['videocodec'], 'duration': result['ref'].duration })
info_tag = core.kodi.set_info_tag(item, video_meta)
info_tag.set_stream_details('video', { 'codec': result['videocodec'], 'duration': result['ref'].duration })

core.utils.end_action(core, True, item)
return link
2 changes: 2 additions & 0 deletions a4kStreaming/lib/kodi.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,14 @@
mod = importlib.import_module(target)
setattr(kodi, target, mod)

set_info_tag = kodi_mock.set_info_tag
else:
import xbmc
import xbmcaddon
import xbmcplugin
import xbmcgui
import xbmcvfs
from .kodi_listitem import set_info_tag

addon = xbmcaddon.Addon('plugin.video.a4kstreaming')
addon_id = addon.getAddonInfo('id')
Expand Down
Loading

0 comments on commit f6695d3

Please sign in to comment.