Created
May 26, 2019 17:39
-
-
Save henryjfry/b50716cbfe40a14bb45b8496452a330c to your computer and use it in GitHub Desktop.
script.skin.helper.widgets - FIX next up episodes and hide episodes which air today.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#~/.kodi/addons/script.skin.helper.widgets/resources/lib/episodes.py | |
## | |
#below "import xbmc" add the following: | |
from resources.lib.utils import log_msg, ADDON_ID | |
import time, datetime | |
from datetime import date | |
from datetime import datetime | |
###### | |
###### | |
###### | |
###### | |
######In the following section "def get_next_episode_for_show(self, show_id):" CHANGE: | |
#fields = ["playcount", "season"] | |
#TO: | |
fields = ["playcount", "season", "firstaired"] | |
##### | |
##### | |
#####Then if you change below the following: | |
# return full details for our episode | |
#return self.metadatautils.kodidb.episode(next_episode["episodeid"]) if next_episode else None | |
# | |
#To (spacing is important here as you are adding an IF statement) | |
# | |
#### | |
# return full details for our episode | |
if date(*map(int, str(next_episode["firstaired"]).split('-')))<date.today(): | |
return self.metadatautils.kodidb.episode(next_episode["episodeid"]) if next_episode else None |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
LOGGING: