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

[script.service.checkpreviousepisode@matrix] 0.4.6 #2581

Merged
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: 3 additions & 3 deletions script.service.checkpreviousepisode/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="script.service.checkpreviousepisode" version="0.4.5" name="Kodi Check Previous Episode" provider-name="bossanova808, Razzeee, Lucleonhart" >
<addon id="script.service.checkpreviousepisode" version="0.4.6" name="Kodi Check Previous Episode" provider-name="bossanova808, Razzeee, Lucleonhart" >
<requires>
<import addon="xbmc.python" version="3.0.0" />
<import addon="script.module.yaml" version="3.11.0" />
Expand All @@ -16,8 +16,8 @@
<forum>https://forum.kodi.tv/showthread.php?tid=355464</forum>
<website>https://kodi.wiki/view/Add-on:XBMC_Check_Previous_Episode</website>
<source>https://github.com/bossanova808/script.service.checkpreviousepisode</source>
<news>v0.4.5
- Fix logic of ignore if previous episode not actually in library
<news>v0.4.6
- Ignore shows that have already been decided on (i.e. those with a non-zero resume point)
</news>
<assets>
<icon>icon.png</icon>
Expand Down
3 changes: 3 additions & 0 deletions script.service.checkpreviousepisode/changelog.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
v0.4.6
- Ignore shows that have already been decided on (i.e. those with a non-zero resume point)

v0.4.5
- Fix logic of ignore if previous episode not actually in library

Expand Down
15 changes: 11 additions & 4 deletions script.service.checkpreviousepisode/resources/lib/player.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ def onAVStarted(self):
"method": "VideoLibrary.GetEpisodeDetails",
"params": {
"episodeid": json_object['result']['item']['id'],
"properties": ["tvshowid", "showtitle", "season", "episode"]
"properties": ["tvshowid", "showtitle", "season", "episode", "resume"]
}
})
json_object = send_kodi_json("Get episode details", command)
Expand All @@ -70,11 +70,18 @@ def onAVStarted(self):
playing_tvshow_title = json_object['result']['episodedetails']['showtitle']
playing_season = json_object['result']['episodedetails']['season']
playing_episode = json_object['result']['episodedetails']['episode']
log(f'Playing - title: {playing_tvshow_title} , id: {playing_tvshowid} , season: {playing_season}, episode: {playing_episode}')
resume_point = json_object['result']['episodedetails']['resume']['position']

log(f'Playing - title: {playing_tvshow_title} , id: {playing_tvshowid} , season: {playing_season}, episode: {playing_episode}, resume: {resume_point}')

# Is show set to be ignored?
if Store.ignored_shows and playing_tvshowid in Store.ignored_shows:
log(f'Show {playing_tvshow_title} set to ignore, carry on...')
log(f'Show {playing_tvshow_title} set to ignore, so allowing.')
return

# Is the resume point is non-zero - then we've previously made a decision about playing this episode, so don't make the user make it again
if resume_point > 0.0:
log(f"Show {playing_tvshow_title} Season {playing_season} Episode {playing_episode} has a non-zero resume point, so decision has been previously made to play this episode, so allowing.")
return

# We ignore first episodes...
Expand Down Expand Up @@ -106,7 +113,7 @@ def onAVStarted(self):
# If we couldn't find the previous episode in the library
# AND the user has asked us to ignore this, we're done.
if not found and Store.ignore_if_episode_absent_from_library:
log("Previous episode was not found, and ignore if absent from library is true")
log("Previous episode was not found in library, and setting ignore if absent from library is true, so allowing.")
return

# If we couldn't find the previous episode in the library,
Expand Down
Loading