diff --git a/addon.xml b/addon.xml index e03327a..a6268bf 100644 --- a/addon.xml +++ b/addon.xml @@ -1,5 +1,5 @@ - + @@ -15,7 +15,8 @@ Nakamori gives you the ability to interact with your Anime collection (via ShokoServer) for Kodi-enabled devices. You are able to use many of the commands available to Desktop right from inside Kodi, such as marking watched status, voting, rescanning and rehashing files, and more! This plugin to work require working ShokoServer instance. https://shokoanime.com - 4.1.6 (10/08/2024) + 4.1.7 (10/08/2024) + [fix] Unsort duration info [fix] running from programs opens settings [fix] classic calendar (ugly prototype) [fix] skin support diff --git a/api/shoko/v2/api2models.py b/api/shoko/v2/api2models.py index f7d443d..dfa0dda 100644 --- a/api/shoko/v2/api2models.py +++ b/api/shoko/v2/api2models.py @@ -487,7 +487,7 @@ def Decoder(json: dict): stream.Title = json.get("Title") stream.Language = json.get("Language") stream.Key = json.get("Key") - stream.Duration = json.get("Duration") + stream.Duration = int(int(json.get("Duration")) / 1000) stream.Height = json.get("Height") stream.Width = json.get("Width") stream.Bitrate = json.get("Bitrate") diff --git a/lib/addon_utils.py b/lib/addon_utils.py index aca61bf..243a072 100644 --- a/lib/addon_utils.py +++ b/lib/addon_utils.py @@ -1,4 +1,4 @@ # -*- coding: utf-8 -*- -import routing +import routing # type: ignore plugin = routing.Plugin() diff --git a/lib/cache.py b/lib/cache.py index 2b9c28e..ec38507 100644 --- a/lib/cache.py +++ b/lib/cache.py @@ -3,10 +3,10 @@ from sqlite3 import dbapi2 as database import os.path import time -import xbmc -import xbmcaddon -import xbmcgui -import xbmcvfs +import xbmc # type: ignore +import xbmcaddon # type: ignore +import xbmcgui # type: ignore +import xbmcvfs # type: ignore from lib.kodi_utils import debug addon = xbmcaddon.Addon('plugin.video.nakamori') diff --git a/lib/external_calendar.py b/lib/external_calendar.py index 245d0c3..2598129 100644 --- a/lib/external_calendar.py +++ b/lib/external_calendar.py @@ -8,9 +8,9 @@ from urllib.error import HTTPError from models.kodi_models import make_text_nice -import xbmc -import xbmcaddon -import xbmcvfs +import xbmc # type: ignore +import xbmcaddon # type: ignore +import xbmcvfs # type: ignore from urllib import request ADDON = xbmcaddon.Addon(id='plugin.video.nakamori') diff --git a/lib/favorite.py b/lib/favorite.py index 064a05d..9bab9ee 100644 --- a/lib/favorite.py +++ b/lib/favorite.py @@ -2,10 +2,10 @@ from sqlite3 import dbapi2 as database import os.path -import xbmc -import xbmcaddon -import xbmcgui -import xbmcvfs +import xbmc # type: ignore +import xbmcaddon # type: ignore +import xbmcgui # type: ignore +import xbmcvfs # type: ignore addon = xbmcaddon.Addon(id='plugin.video.nakamori') diff --git a/lib/kodi_utils.py b/lib/kodi_utils.py index b1bf5bf..9fdccaf 100644 --- a/lib/kodi_utils.py +++ b/lib/kodi_utils.py @@ -3,10 +3,10 @@ import os from uuid import uuid4 -import xbmcaddon -import xbmcvfs -import xbmcgui -import xbmc +import xbmcaddon # type: ignore +import xbmcvfs # type: ignore +import xbmcgui # type: ignore +import xbmc # type: ignore plugin_addon = xbmcaddon.Addon('plugin.video.nakamori') diff --git a/lib/naka_player.py b/lib/naka_player.py index e8620ae..8022107 100644 --- a/lib/naka_player.py +++ b/lib/naka_player.py @@ -1,8 +1,8 @@ # -*- coding: utf-8 -*- -import xbmc -import xbmcgui -import xbmcplugin -import xbmcaddon +import xbmc # type: ignore +import xbmcgui # type: ignore +import xbmcplugin # type: ignore +import xbmcaddon # type: ignore from lib.kodi_utils import get_device_id, message_box, debug from models.kodi_models import set_watch_mark, is_series_watched, vote_for_episode, vote_for_series diff --git a/lib/nakamori_utils.py b/lib/nakamori_utils.py index 291f518..8c39217 100644 --- a/lib/nakamori_utils.py +++ b/lib/nakamori_utils.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- -import xbmcaddon -import xbmc +import xbmcaddon # type: ignore +import xbmc # type: ignore from urllib.parse import urlparse, quote, unquote_plus, quote_plus, urlencode from urllib.request import urlopen, Request diff --git a/lib/search.py b/lib/search.py index b22aa97..770a868 100644 --- a/lib/search.py +++ b/lib/search.py @@ -2,10 +2,10 @@ from sqlite3 import dbapi2 as database import os.path -import xbmc -import xbmcaddon -import xbmcgui -import xbmcvfs +import xbmc # type: ignore +import xbmcaddon # type: ignore +import xbmcgui # type: ignore +import xbmcvfs # type: ignore addon = xbmcaddon.Addon(id='plugin.video.nakamori') diff --git a/lib/shoko_utils.py b/lib/shoko_utils.py index f46bc1f..c7fdee0 100644 --- a/lib/shoko_utils.py +++ b/lib/shoko_utils.py @@ -1,8 +1,8 @@ # -*- coding: utf-8 -*- -import xbmcaddon -import xbmcgui -import xbmc +import xbmcaddon # type: ignore +import xbmcgui # type: ignore +import xbmc # type: ignore import json diff --git a/lib/windows/ac_calendar.py b/lib/windows/ac_calendar.py index 504669a..6b4d419 100644 --- a/lib/windows/ac_calendar.py +++ b/lib/windows/ac_calendar.py @@ -2,7 +2,7 @@ import time import json import datetime -import xbmcvfs +import xbmcvfs # type: ignore from models.kodi_models import * from api.shoko.v2 import api2models diff --git a/lib/windows/wizard.py b/lib/windows/wizard.py index 1d26660..344f510 100644 --- a/lib/windows/wizard.py +++ b/lib/windows/wizard.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- -import xbmcgui -import xbmcaddon +import xbmcgui # type: ignore +import xbmcaddon # type: ignore from lib import shoko_utils, kodi_utils diff --git a/models/kodi_models.py b/models/kodi_models.py index 6152e62..391ed92 100644 --- a/models/kodi_models.py +++ b/models/kodi_models.py @@ -1,13 +1,13 @@ # -*- coding: utf-8 -*- from api.shoko.v2 import api2, api2models -import xbmc -import xbmcaddon -import xbmcgui -from xbmcgui import ListItem -import xbmcplugin +import xbmc # type: ignore +import xbmcaddon # type: ignore +import xbmcgui # type: ignore +from xbmcgui import ListItem # type: ignore +import xbmcplugin # type: ignore import re from api.shoko.v3 import api3 -import routing +import routing # type: ignore from lib.kodi_utils import bold, debug from lib.shoko_utils import get_tag_setting_flag @@ -201,7 +201,9 @@ def get_listitem_from_episode(x: api2models.Episode, series_title: str = '', cas def get_listitem_from_rawfile(x: api2models.RawFile) -> ListItem: name = get_file_name(x.filename) li = ListItem(name, path=x.url, offscreen=True) - + from lib.kodi_utils import debug as d + d("---------------------------") + d(str(x)) set_folder(li, True) set_info_for_rawfile(li, x) set_stream_info(li, x) @@ -531,7 +533,8 @@ def set_info_for_rawfile(li: ListItem, x: api2models.RawFile): 'originaltitle': x.filename, 'sorttitle': x.filename, 'mediatype': 'file', - 'playcount': 0 + 'playcount': 0, + 'duration': x.duration / 1000 } li.setInfo('video', video) @@ -696,12 +699,15 @@ def set_stream_info(li: ListItem, r: api2models.RawFile): for a in r.media.audios: audio = {'codec': a.Codec, 'language': a.Language, 'channels': a.Channels} li.addStreamInfo('audio', audio) + # li.addAudioStream(audio) for v in r.media.videos: video = {'codes': v.Codec, 'width': v.Width, 'heigh': v.Height, 'duration': v.Duration} li.addStreamInfo('video', video) + # li.addVideoStream(video) for s in r.media.subtitles: subtitle = {'language': s.Language} li.addStreamInfo('subtitle', subtitle) + # li.addSubtitleStream(subtitle) def add_context_menu_for_series(li: ListItem, s: api2models.Serie, was_watched: WatchedStatus):