Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
d8e52d3
Fixing getEpisodeTVDB
the-lazy-fox Apr 25, 2018
3d7f0c2
Merge pull request #1 from alxlaxv/patch-1
the-lazy-fox Apr 25, 2018
6a079a0
Update french strings
the-lazy-fox Apr 25, 2018
6e381b6
Update addon.xml
the-lazy-fox Apr 25, 2018
9f97a65
Update README.md
the-lazy-fox May 23, 2018
88521d0
Fixed getEpisodeTVDB for tv episodes without an tvdb ID
kvanzuijlen Jul 16, 2018
b662e22
Merge pull request #2 from kvanzuijlen/patch-2
the-lazy-fox Oct 30, 2018
67ae0e7
Update addon.xml
the-lazy-fox Oct 30, 2018
0c71ecd
Reverting IMDb feature
the-lazy-fox Apr 24, 2019
f847997
Update addon.xml
the-lazy-fox Apr 24, 2019
faa1f85
Fix issues finding episode using Kodi 18.3
JosemyAB Aug 5, 2019
72b389f
Merge pull request #8 from JosemyAB/master
the-lazy-fox Aug 6, 2019
478f13e
Add support for Kodi 19 (kodi libs and python3)
RSantos94 Dec 4, 2020
e35d0f8
fixed all api issues
panizza Mar 17, 2021
91a6488
upgraded respecting kodi 19 changes
panizza Mar 17, 2021
4fa0062
Merge pull request #1 from panizza/master
RSantos94 Mar 17, 2021
ac200f0
Merge pull request #12 from RSantos94/master
the-lazy-fox Mar 17, 2021
8f8ac9d
Update addon.xml
the-lazy-fox Mar 18, 2021
a3102d2
Update README.md
the-lazy-fox Mar 18, 2021
05d31f0
fixed python3 errors
panizza Mar 19, 2021
2fa5df9
Merge pull request #16 from panizza/master
the-lazy-fox Mar 20, 2021
b8bd8cb
Refactoring
panizza Mar 22, 2021
dbd7cee
refactoring fixes
panizza Mar 22, 2021
64d66b0
refactoring fixes
panizza Mar 22, 2021
9eb1bf2
Added autofollow
panizza Mar 22, 2021
49eaaea
Added autofollow
panizza Mar 22, 2021
58bc4a8
Merge pull request #17 from panizza/master
the-lazy-fox Apr 12, 2021
87e3a06
Update addon.xml
the-lazy-fox Apr 12, 2021
31af403
Update README.md
the-lazy-fox May 7, 2021
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
58 changes: 17 additions & 41 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,53 +1,29 @@
script.tvtime
=================
# Notice ⚠️
TV Time has officially stopped its API and this addon for Kodi is based on it. Therefore this addon is not work anymore until further notice.
Please see #5 for more details and alternatives

# script.tvtime

Kodi plugin for [TV Time](http://www.tvtime.com)

This plugin will set TV shows episodes you've seen as watched on TV Time.
It will also add the new TV show to your account if it was not already there.

install
=======

This plugin has been submitted to the [official Kodi repository](http://addons.xbmc.org/show/script.tvtime/).
To install it, just follow this [HOW-TO](http://kodi.wiki/view/HOW-TO:Install_add-ons).
After that, launch the add-on to login.

build
=====

If you want to build it manually, here is a simple script to do so:
```sh
#!/bin/bash

dest=script.tvtime
version=$(grep -E "^\s+version" addon.xml | cut -f2 -d'"')
This fork has been created to be able to apply some fixes on the initial repository (hibernating/dead) but it will never be submitted to the official Kodi repository.
Please follow Build or Download steps below to install this version.

if [ -d $dest ]; then
rm -r $dest
fi
## Build

mkdir $dest
cp addon.xml $dest/
cp *.txt $dest/
cp icon.png $dest/
cp *.py $dest/
cp -r resources $dest/
If you want to build it manually, please follow the steps below:

if [ -f $dest-$version.zip ]; then
rm $dest-$version.zip
fi
1. Clone this repository `sudo git clone https://github.com/the-lazy-fox/script.tvtime.git`
2. Enter in script.tvtime `cd script.tvtime`
3. Make the compile script executable `sudo chmod +x compile.sh`
4. Launch the compile script `./compile.sh`

zip -r $dest-$version.zip $dest
rm -r $dest
````
It will create a zip file that you can install directly within Kodi.
Using the GUI of Kodi, choose to install your plugin as a zip file, find your zip file and it's done !
It will create a zip file which can be installed directly within Kodi by following this [HOW-TO](https://kodi.wiki/view/Add-on_manager#How_to_install_from_a_ZIP_file).

download
========
## Download

If you want to download the release package because you can't or don't want to build it, you can do it on this link:
http://addons.xbmc.org/show/script.tvtime/
or
[download](here) the latests version.
You can down the [last release](https://github.com/alxlaxv/script.tvtime/releases/latest) directly.
It will download a zip file which can be installed directly within Kodi by following this [HOW-TO](https://kodi.wiki/view/Add-on_manager#How_to_install_from_a_ZIP_file).
12 changes: 6 additions & 6 deletions addon.xml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<addon id="script.tvtime"
name="TV Time"
version="1.2.0"
provider-name="CXII">
version="2.0.2"
provider-name="the-lazy-fox">
<requires>
<import addon="xbmc.python" version="2.19.0"/>
<import addon="xbmc.python" version="3.0.0"/>
</requires>
<extension point="xbmc.python.script" library="program.py">
<provides>executable</provides>
Expand All @@ -19,9 +19,9 @@
<language>en fr it</language>
<license>GNU GENERAL PUBLIC LICENSE. Version 2, June 1991</license>
<forum>http://forum.kodi.tv/showthread.php?tid=199604</forum>
<website>https://github.com/cxii-dev/script.tvtime</website>
<source>https://github.com/cxii-dev/script.tvtime.git</source>
<email>cxii-dev[AT]users[DOT]noreply[DOT]github[DOT]com</email>
<website>https://github.com/alxlaxv/script.tvtime</website>
<source>https://github.com/alxlaxv/script.tvtime.git</source>
<email>alxlaxv[AT]users[DOT]noreply[DOT]github[DOT]com</email>
</extension>
</addon>

480 changes: 279 additions & 201 deletions default.py

Large diffs are not rendered by default.

25 changes: 13 additions & 12 deletions program.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import sys
import threading
import xbmc
import xbmcvfs
import xbmcgui
import xbmcaddon
import unicodedata
Expand All @@ -32,7 +33,7 @@
__version__ = __addon__.getAddonInfo('version')
__language__ = __addon__.getLocalizedString
__resource_path__ = os.path.join(__cwd__, 'resources', 'lib')
__resource__ = xbmc.translatePath(__resource_path__).decode('utf-8')
__resource__ = xbmcvfs.translatePath(__resource_path__)

__token__ = __addon__.getSetting('token')
__facebook__ = __addon__.getSetting('facebook')
Expand All @@ -42,14 +43,14 @@

def start():
menuitems = []
if __token__ is '':
if __token__ == '':
menuitems.append(__language__(33801))
else:
menuitems.append(__language__(33803))
menuitems.append(__language__(33802))
startmenu = xbmcgui.Dialog().select(__scriptname__, menuitems)
if startmenu < 0: return
elif startmenu == 0 and __token__ is '':
elif startmenu == 0 and __token__ == '':
_login = GetCode()
if _login.is_code:
Authorization(_login.verification_url, _login.user_code, _login.device_code)
Expand All @@ -67,7 +68,7 @@ def start():

def Authorization(verification_url, user_code, device_code):
pDialog = xbmcgui.DialogProgress()
pDialog.create(__scriptname__, "%s: %s" % (__language__(33806), verification_url), "%s: %s" % (__language__(33807), user_code))
pDialog.create(__scriptname__, "%s: %s\n%s: %s" % (__language__(33806), verification_url, __language__(33807), user_code))
for i in range(0, 100):
pDialog.update(i)
xbmc.sleep(5000)
Expand All @@ -78,7 +79,7 @@ def Authorization(verification_url, user_code, device_code):
user = GetUserInformations(_authorize.access_token)
if user.is_authenticated:
if __welcome__ == 'true':
xbmcgui.Dialog().ok(__scriptname__, '%s %s' % (__language__(32902), user.username), __language__(33808))
xbmcgui.Dialog().ok(__scriptname__, '%s %s\n%s' % (__language__(32902), user.username, __language__(33808)))
__addon__.setSetting('user', user.username)
return
pDialog.close()
Expand Down Expand Up @@ -141,7 +142,7 @@ def scan(way):
total = len(tvshowsList)
for tvshowList in tvshowsList:
cpt = cpt + 1
pc = (cpt*100)/total
pc = int((cpt*100)/total)
pDialog.update(pc, message=tvshowList['title'])
xbmc.sleep(100)
if tvshowList['seen'] == 1:
Expand All @@ -164,7 +165,7 @@ def scan(way):
pDialog.update(0, message=__language__(33908))
for showSeen in showsSeen:
cpt = cpt + 1
pc = (cpt*100)/total
pc = int((cpt*100)/total)
tempShowsSeen.append({
'show_id': int(showSeen['show_id']),
'season': showSeen['season'],
Expand All @@ -188,7 +189,7 @@ def scan(way):
pDialog.update(0, message=__language__(33908))
for showNotSeen in showsNotSeen:
cpt = cpt + 1
pc = (cpt*100)/total
pc = int((cpt*100)/total)
tempShowsNotSeen.append({
'show_id': int(showNotSeen['show_id'])
})
Expand Down Expand Up @@ -221,7 +222,7 @@ def scan(way):
for i in range(0, total):
for tvshowTime in tvshowTimeList:
if int(tvshowList[i]['show_id']) == int(tvshowTime['show_id']):
pDialog.update(((100/total)*(i+1)), message=tvshowTime['title'])
pDialog.update(int((100/total)*(i+1)), message=tvshowTime['title'])
log('setTvshowProgress(%s, %s, %s)' % (tvshowTime['show_id'], tvshowTime['season'], tvshowTime['episode']))
tvshowProgress = setTvshowProgress(tvshowTime['show_id'], tvshowTime['season'], tvshowTime['episode'])
pDialog.update(100, message=__language__(33907))
Expand All @@ -236,7 +237,7 @@ def getTvshowList():
tvshows = json.loads(result)
log('tvshows=%s' % tvshows)
tvshowList = []
if tvshows.has_key('result') and tvshows['result'] != None and tvshows['result'].has_key('tvshows'):
if 'result' in tvshows and tvshows['result'] != None and 'tvshows' in tvshows['result']:
tvshows = tvshows['result']['tvshows']
for tvshow in tvshows:
rpccmd = {'jsonrpc': '2.0', 'method': 'VideoLibrary.GetEpisodes', 'params': {'tvshowid': tvshow['tvshowid'], 'properties': ['season', 'episode', 'playcount']}, 'id': 1}
Expand All @@ -245,7 +246,7 @@ def getTvshowList():
episodes = json.loads(result)
log('tvshow=%s [%s]' % (tvshow['title'], tvshow['imdbnumber']))
log('episodes[%s]=%s' % (tvshow['imdbnumber'], episodes))
if episodes.has_key('result') and episodes['result'] != None and episodes['result'].has_key('episodes'):
if 'result' in episodes and episodes['result'] != None and 'episodes' in episodes['result']:
episodes = episodes['result']['episodes']
lastEpisode = None
lastSeasonNr = 0
Expand Down Expand Up @@ -321,7 +322,7 @@ def setTvshowProgress(show_id, last_season_seen, last_episode_seen):
rpccmd = json.dumps(rpccmd)
result = xbmc.executeJSONRPC(rpccmd)
episodes = json.loads(result)
log('episodes=%s' % episodes)
log('episodes=%s' % episodes)
if episodes['result']['limits']['total'] > 0:
episodes = episodes['result']['episodes']
for episode in episodes:
Expand Down
4 changes: 4 additions & 0 deletions resources/language/English/strings.po
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,10 @@ msgctxt "#32303"
msgid "Mark the http streams"
msgstr ""

msgctxt "#32304"
msgid "Auto-follow the show if not already followed"
msgstr ""

msgctxt "#33001"
msgid "Notifications"
msgstr ""
Expand Down
12 changes: 8 additions & 4 deletions resources/language/French/strings.po
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,10 @@ msgctxt "#32303"
msgid "Mark the http streams"
msgstr "Marquer les flux http"

msgctxt "#32304"
msgid "Auto-follow the show if not already followed"
msgstr "Suivre automatiquement le spectacle s'il n'est pas déjà suivi"

msgctxt "#33001"
msgid "Notifications"
msgstr "Notifications"
Expand Down Expand Up @@ -91,23 +95,23 @@ msgstr "Bien"

msgctxt "#35312"
msgid "Funk"
msgstr "Fun"
msgstr "Drole"

msgctxt "#35313"
msgid "Wow"
msgstr "Wow"

msgctxt "#35314"
msgid "Sad"
msgstr "triste"
msgstr "Triste"

msgctxt "#35316"
msgid "Soso"
msgstr "Mitigé"
msgstr "Bof"

msgctxt "#35317"
msgid "Bad"
msgstr "Mauvais"
msgstr "Nul"

msgctxt "#32901"
msgid "Please login"
Expand Down
4 changes: 4 additions & 0 deletions resources/language/Italian/strings.po
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,10 @@ msgctxt "#32303"
msgid "Mark the http streams"
msgstr "Segna i flussi http"

msgctxt "#32304"
msgid "Auto-follow the show if not already followed"
msgstr "Segui automaticamente lo show se non è già seguito"

msgctxt "#33001"
msgid "Notifications"
msgstr "Notifiche"
Expand Down
Loading