Skip to content

Commit

Permalink
Unsort duration fixed;
Browse files Browse the repository at this point in the history
  • Loading branch information
bigretromike committed Aug 10, 2024
1 parent adfa1fc commit 8bfbd80
Show file tree
Hide file tree
Showing 14 changed files with 50 additions and 43 deletions.
5 changes: 3 additions & 2 deletions addon.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<addon id="plugin.video.nakamori" name="Nakamori" version="4.1.6" provider-name="BigRetroMike, SteveMavic, da3dsoul">
<addon id="plugin.video.nakamori" name="Nakamori" version="4.1.7" provider-name="BigRetroMike, SteveMavic, da3dsoul">
<requires>
<import addon="xbmc.python" version="3.0.0"/>
<import addon="script.module.routing" version="0.2.3"/>
Expand All @@ -15,7 +15,8 @@
<description lang="en_GB">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!</description>
<disclaimer lang="en_GB">This plugin to work require working ShokoServer instance. https://shokoanime.com</disclaimer>
<news>
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
Expand Down
2 changes: 1 addition & 1 deletion api/shoko/v2/api2models.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
2 changes: 1 addition & 1 deletion lib/addon_utils.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# -*- coding: utf-8 -*-
import routing
import routing # type: ignore

plugin = routing.Plugin()
8 changes: 4 additions & 4 deletions lib/cache.py
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand Down
6 changes: 3 additions & 3 deletions lib/external_calendar.py
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand Down
8 changes: 4 additions & 4 deletions lib/favorite.py
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand Down
8 changes: 4 additions & 4 deletions lib/kodi_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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')

Expand Down
8 changes: 4 additions & 4 deletions lib/naka_player.py
Original file line number Diff line number Diff line change
@@ -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
Expand Down
4 changes: 2 additions & 2 deletions lib/nakamori_utils.py
Original file line number Diff line number Diff line change
@@ -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
Expand Down
8 changes: 4 additions & 4 deletions lib/search.py
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand Down
6 changes: 3 additions & 3 deletions lib/shoko_utils.py
Original file line number Diff line number Diff line change
@@ -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

Expand Down
2 changes: 1 addition & 1 deletion lib/windows/ac_calendar.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions lib/windows/wizard.py
Original file line number Diff line number Diff line change
@@ -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

Expand Down
22 changes: 14 additions & 8 deletions models/kodi_models.py
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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)

Expand Down Expand Up @@ -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):
Expand Down

0 comments on commit 8bfbd80

Please sign in to comment.