From b7e6143794b7ae70b0a67e9e2745de449a294133 Mon Sep 17 00:00:00 2001 From: bigretromike Date: Tue, 2 Oct 2018 18:45:06 +0200 Subject: [PATCH 1/6] fix ? - more testing needed; --- addon.xml | 4 ++-- lib/nakamoriplayer.py | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/addon.xml b/addon.xml index 998cedb..78cbf99 100644 --- a/addon.xml +++ b/addon.xml @@ -1,5 +1,5 @@ - + @@ -11,7 +11,7 @@ Nakamori Player Module This module handle all the player related functions inside Nakamori - 3.0.6[CR]- more frequent sync calling + 3.0.7[CR]- fix for missing onPlayBackStopped all GNU GENERAL PUBLIC LICENSE. Version 2, June 1991 https://shokunin.monogatari.pl/ diff --git a/lib/nakamoriplayer.py b/lib/nakamoriplayer.py index 2168157..346b14f 100644 --- a/lib/nakamoriplayer.py +++ b/lib/nakamoriplayer.py @@ -96,6 +96,8 @@ def onPlayBackStarted(self): self.Metadata['shoko:rawid'] = self._details['rawid'] self.PlaybackStatus = 'Playing' + while not self.isPlaying(): + xbmc.sleep(10) duration = self.getTotalTime() if self.Transcoded: duration = self.Metadata.get('shoko:duration') From 1391e201a015a417094e285f1bcf086a00ae3c0f Mon Sep 17 00:00:00 2001 From: bigretromike Date: Tue, 2 Oct 2018 18:50:15 +0200 Subject: [PATCH 2/6] also this; --- lib/nakamoriplayer.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/nakamoriplayer.py b/lib/nakamoriplayer.py index 346b14f..404b7ea 100644 --- a/lib/nakamoriplayer.py +++ b/lib/nakamoriplayer.py @@ -53,7 +53,7 @@ def did_i_watch_entire_episode(current_time, total_time, ep_id, user_rate): class Service(xbmc.Player): def __init__(self): log('Init') - # xbmc.Player.__init__(self) + xbmc.Player.__init__(self) self._t = None # trakt thread self._s = None # sync thread self._details = None From 07d859bd0526ed0f1218b3c091a81cf7482e29d4 Mon Sep 17 00:00:00 2001 From: bigretromike Date: Tue, 2 Oct 2018 20:16:31 +0200 Subject: [PATCH 3/6] just because someone wrote not to mix those; --- lib/nakamoriplayer.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/nakamoriplayer.py b/lib/nakamoriplayer.py index 404b7ea..7bd6fa9 100644 --- a/lib/nakamoriplayer.py +++ b/lib/nakamoriplayer.py @@ -162,7 +162,7 @@ def update_trakt(self): self.Metadata.get('shoko:duration'), self.Metadata.get('shoko:movie'), self.Metadata.get('shoko:traktonce')) self.Metadata['shoko:traktonce'] = False - time.sleep(5) + xbmc.sleep(5) else: log("trakt_thread: not playing anything") return @@ -173,7 +173,7 @@ def update_sync(self): if nt.addon.getSetting("syncwatched") == "true" and self.getTime() > 10: self.Metadata['shoko:current'] = self.getTime() nt.sync_offset(self.Metadata.get('shoko:fileid'), self.Metadata.get('shoko:current')) - time.sleep(1) + xbmc.sleep(1) except: pass # while buffering else: From eb342c6e856b93e9828a1ebd029291c9ba0e1aef Mon Sep 17 00:00:00 2001 From: da3dsoul Date: Tue, 9 Oct 2018 05:56:13 -0400 Subject: [PATCH 4/6] Fix lots of little things. Add Clear Image Cache --- lib/nakamoriplayer.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/lib/nakamoriplayer.py b/lib/nakamoriplayer.py index 7bd6fa9..c3051f3 100644 --- a/lib/nakamoriplayer.py +++ b/lib/nakamoriplayer.py @@ -32,7 +32,7 @@ def did_i_watch_entire_episode(current_time, total_time, ep_id, user_rate): mark = float(nt.addon.getSetting("watched_mark")) mark /= 100 log('mark = %s * total = %s = %s < current = %s' % (mark, total_time, (total_time*mark), current_time)) - if (total_time * mark) < current_time: + if (total_time * mark) <= current_time: _finished = True else: # external set position = 1.0 when it want to mark it as watched (based on configuration of external) @@ -162,7 +162,8 @@ def update_trakt(self): self.Metadata.get('shoko:duration'), self.Metadata.get('shoko:movie'), self.Metadata.get('shoko:traktonce')) self.Metadata['shoko:traktonce'] = False - xbmc.sleep(5) + # xbmc.sleep uses ms, which would be obvious if you used an IDE + xbmc.sleep(5000) else: log("trakt_thread: not playing anything") return @@ -173,7 +174,8 @@ def update_sync(self): if nt.addon.getSetting("syncwatched") == "true" and self.getTime() > 10: self.Metadata['shoko:current'] = self.getTime() nt.sync_offset(self.Metadata.get('shoko:fileid'), self.Metadata.get('shoko:current')) - xbmc.sleep(1) + # xbmc.sleep uses ms, which would be obvious if you used an IDE + xbmc.sleep(1000) except: pass # while buffering else: From 87fd58ba993e9c0ced7348cc4d5b69806bd9c814 Mon Sep 17 00:00:00 2001 From: bigretromike Date: Tue, 9 Oct 2018 21:19:57 +0200 Subject: [PATCH 5/6] checking; --- lib/nakamoriplayer.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/nakamoriplayer.py b/lib/nakamoriplayer.py index 7bd6fa9..b20a5d9 100644 --- a/lib/nakamoriplayer.py +++ b/lib/nakamoriplayer.py @@ -88,7 +88,7 @@ def onPlayBackStarted(self): self.Metadata['shoko:current'] = 0 # if I recall k17 give second * 1000 and k18 give only seconds real_duration = int(self._details['duration']) - self.Metadata['shoko:duration'] = real_duration if real_duration < 1000000 else real_duration/1000 + self.Metadata['shoko:duration'] = real_duration/1000 # if real_duration < 1000000 else real_duration/1000 self.Metadata['shoko:epid'] = self._details['epid'] self.Metadata['shoko:movie'] = self._details['movie'] self.Metadata['shoko:fileid'] = self._details['fileid'] From a667c1c46438230c5be25e58ec2053d1c7bc1222 Mon Sep 17 00:00:00 2001 From: bigretromike Date: Tue, 9 Oct 2018 21:28:49 +0200 Subject: [PATCH 6/6] ~ xbmc.sleep ~ --- lib/nakamoriplayer.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/lib/nakamoriplayer.py b/lib/nakamoriplayer.py index 12bd8cf..b808a61 100644 --- a/lib/nakamoriplayer.py +++ b/lib/nakamoriplayer.py @@ -97,7 +97,7 @@ def onPlayBackStarted(self): self.PlaybackStatus = 'Playing' while not self.isPlaying(): - xbmc.sleep(10) + xbmc.sleep(100) duration = self.getTotalTime() if self.Transcoded: duration = self.Metadata.get('shoko:duration') @@ -162,8 +162,7 @@ def update_trakt(self): self.Metadata.get('shoko:duration'), self.Metadata.get('shoko:movie'), self.Metadata.get('shoko:traktonce')) self.Metadata['shoko:traktonce'] = False - # xbmc.sleep uses ms, which would be obvious if you used an IDE - xbmc.sleep(5000) + xbmc.sleep(1000) else: log("trakt_thread: not playing anything") return @@ -174,8 +173,7 @@ def update_sync(self): if nt.addon.getSetting("syncwatched") == "true" and self.getTime() > 10: self.Metadata['shoko:current'] = self.getTime() nt.sync_offset(self.Metadata.get('shoko:fileid'), self.Metadata.get('shoko:current')) - # xbmc.sleep uses ms, which would be obvious if you used an IDE - xbmc.sleep(1000) + xbmc.sleep(100) except: pass # while buffering else: