'Sends a request to trakt indicating that the given show and all its episodes is part of our library.
show_obj: The TVShow object to add to trakt'

def addShowToTraktLibrary(self, show_obj):

    data = {}
    if (not self.findShow(show_obj.indexer, show_obj.indexerid)):
        trakt_id = sickbeard.indexerApi(show_obj.indexer).config[u'trakt_id']
        data = {u'shows': [{u'title': show_obj.name, u'year': show_obj.startyear, u'ids': {}}]}
        if (trakt_id == u'tvdb_id'):
            data[u'shows'][0][u'ids'][u'tvdb'] = show_obj.indexerid
        else:
            data[u'shows'][0][u'ids'][u'tvrage'] = show_obj.indexerid
    if data:
        logger.log(u'Adding    {0}    to    trakt.tv    library'.format(show_obj.name), logger.DEBUG)
        try:
            self.trakt_api.traktRequest(u'sync/collection', data, method=u'POST')
        except traktException as e:
            logger.log(u'Could    not    connect    to    Trakt    service.    Aborting    adding    show    {0}    to    Trakt    library.    Error:    {1}'.format(show_obj.name, repr(e)), logger.WARNING)
            return
