 Trakttv = require('trakttv')
 menus = require('menus')
 cards = require('cards')
-
-subscriptionsAlreadyUpdated = false
 
 setupLogging = () ->
   @originalFactory ?= log.methodFactory



updateSubscriptions = (shows) ->
  if subscriptionsAlreadyUpdated
    return

  watchingShowIDs = ("#{item.show.ids.trakt}" for item in shows)
  log.info "The user is watching the following shows:

    (err, status, request) ->
      log.error("GOT error: #{JSON.stringify err}")
      if status == null
        err = new Error("Unable to connect to the server.")
      else
        err = new Error("Communication error (#{status}).")
      callback err
