Skip to content

Commit

Permalink
Merge pull request #216 from Razzeee/master
Browse files Browse the repository at this point in the history
Merge version 3.0.1
  • Loading branch information
razzeee committed May 6, 2015
2 parents 2c2bfda + eab0c14 commit 399d1f6
Show file tree
Hide file tree
Showing 94 changed files with 5,364 additions and 3,825 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,6 @@
.DS*
.pylint_rc
/.idea
/.project
/.pydevproject
/.settings
20 changes: 18 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,19 @@
Trakt.tv scrobbler and library sync
==============================================

###Table of Contents
* [What is Trakt?](#what-is-trakt)
* [What can this addon do?](#what-can-this-addon-do)
* [What can be scrobbled??](#what-can-be-scrobbled)
* [Installation](#installation)
* [Problems?](#problems)
* ["I found something that doesn't work"](#i-found-something-that-doesnt-work)
* [Creating logfiles](#creating-logfiles)
* [Contribute](#contribute)
* [Pull requests](#pull-requests)
* [Translations](#translations)
* [Thanks](#thanks)

###What is Trakt?
Automatically scrobble all TV episodes and movies you are watching to Trakt.tv! Keep a comprehensive history of everything you've watched and be part of a global community of TV and movie enthusiasts. Sign up for a free account at [Trakt.tv](http://trakt.tv) and get a ton of features:

Expand Down Expand Up @@ -30,6 +43,8 @@ This plugin will scrobble local media and most remote streaming content. Local m
Remote streaming content will scrobble assuming the metadata is correctly set in Kodi. Add-ons that stream content need to correctly identify TV episodes and movies with as much metadata as possible for Trakt to know what you're watching.

###Installation
If your not a developer, you should only install this from the official Kodi repo via Kodi itself. If you are a dev, here is how you install the dev version:

1. Download the zip ([download it here](../../zipball/master))
2. Install script.trakt by zip. Go to *Settings* > *Add-ons* > *Install from zip file* > Choose the just downloaded zip
3. Navigate to *Settings* > *Add-ons* > *Enabled add-ons* > *Services* > **Trakt**
Expand All @@ -55,12 +70,13 @@ or
* If not, create a new issue and provide as much data about your system as possible, a logfile will also be needed.

####Creating logfiles
* To create a logfile, enable the debug setting in Kodi AND script.trakt, otherwise the logfile won't show any data from script.trakt. Check the Kodi documentation if you don't know where your logfile can be found.
* To create a logfile, enable the debug setting in Kodi AND script.trakt, otherwise the logfile won't show any data from script.trakt. Check the [Kodi documentation] (http://kodi.wiki/view/Log_file) if you don't know where your logfile can be found.

###Contribute

####Pull requests
* Please make your pull requests on the branch named "dev" only.
* Please make your pull requests on the branch named "dev" only.
* Please don't add pull requests for translation updates these have to go work their way through the translation workflow (see [Translations](#translations))

####Translations
* Translations are done via the Transifex project of Kodi. If you want to support translation efforts, read [this] (http://kodi.wiki/view/Translation_System) and look for script-trakt under the XBMC Addons project in Transifex.
Expand Down
21 changes: 12 additions & 9 deletions addon.xml

Large diffs are not rendered by default.

10 changes: 10 additions & 0 deletions changelog.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
version 3.0.1
- moved to PIN login, you will need to reenter your credentials. It's more secure and users with social logins (e.g. g+ or fb) can now login too!
- readded manual ratings for movies/shows/episodes (by tknorris)
- implemented manual ratings for seasons (by tknorris)
- readded manual ratings for movies/shows/seasons/episodes
- readded the Trakt contextmenu
- multipart episodes now show a rating dialog for each episode, when playback is finished
- use kodi proxy to send requests to trakt
- updated transifex translations

version 3.0.0
- new Trakt branded rating dialog (by Piers)
- ported to Trakt.tv api v2 (using trakt.py by fuzeman)
Expand Down
6 changes: 3 additions & 3 deletions default.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@
logger.debug("Loading '%s' version '%s'" % (__addonid__, __addonversion__))

try:
traktService().run()
traktService().run()
except Exception as ex:
message = createError(ex)
logger.fatal(message)
message = createError(ex)
logger.fatal(message)

logger.debug("'%s' shutting down." % __addonid__)
57 changes: 27 additions & 30 deletions kodilogging.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,35 +25,32 @@

class KodiLogHandler(logging.StreamHandler):

def __init__(self):
logging.StreamHandler.__init__(self)
addon_id = xbmcaddon.Addon().getAddonInfo('id')
prefix = b"[%s] " % addon_id
formatter = logging.Formatter(prefix + b'%(name)s: %(message)s')
self.setFormatter(formatter)

def emit(self, record):
levels = {
logging.CRITICAL: xbmc.LOGFATAL,
logging.ERROR: xbmc.LOGERROR,
logging.WARNING: xbmc.LOGWARNING,
logging.INFO: xbmc.LOGINFO,
logging.DEBUG: xbmc.LOGDEBUG,
logging.NOTSET: xbmc.LOGNONE,
}
if getSettingAsBool('debug'):
try:
xbmc.log(self.format(record), levels[record.levelno])
except UnicodeEncodeError:
xbmc.log(self.format(record).encode('utf-8', 'ignore'), levels[record.levelno])



def flush(self):
pass

def __init__(self):
logging.StreamHandler.__init__(self)
addon_id = xbmcaddon.Addon().getAddonInfo('id')
prefix = b"[%s] " % addon_id
formatter = logging.Formatter(prefix + b'%(name)s: %(message)s')
self.setFormatter(formatter)

def emit(self, record):
levels = {
logging.CRITICAL: xbmc.LOGFATAL,
logging.ERROR: xbmc.LOGERROR,
logging.WARNING: xbmc.LOGWARNING,
logging.INFO: xbmc.LOGINFO,
logging.DEBUG: xbmc.LOGDEBUG,
logging.NOTSET: xbmc.LOGNONE,
}
if getSettingAsBool('debug'):
try:
xbmc.log(self.format(record), levels[record.levelno])
except UnicodeEncodeError:
xbmc.log(self.format(record).encode('utf-8', 'ignore'), levels[record.levelno])

def flush(self):
pass

def config():
logger = logging.getLogger()
logger.addHandler(KodiLogHandler())
logger.setLevel(logging.DEBUG)
logger = logging.getLogger()
logger.addHandler(KodiLogHandler())
logger.setLevel(logging.DEBUG)
Loading

0 comments on commit 399d1f6

Please sign in to comment.