 
 
 traktvRequest = (opt, success, failure) ->
-  # console.log "traktvRequest: opt: #{JSON.stringify opt}"
+  console.log "traktvRequest: opt: #{JSON.stringify opt}"
   # console.log success
   if typeof opt == 'string'
     opt = if opt.indexOf('http') == 0

  traktvRequest "/shows/#{showID}/progress/watched",
    (response, status, req) ->
      console.log "Reloading show #{showID}"
      item = i for i in shows when i.show.ids.trakt == showID

      item.next_episode = response.next_episode
      item.seasons = response.seasons
      success(item) if success?
    failure if failure?

getToWatchList = (showList, callback) ->
  showListUpdated = showList[..]

    method: 'POST'
    data: request
    (response, status, req) ->
      console.log "Check succeeded: req: #{JSON.stringify request}"
      console.log "response: #{JSON.stringify response}"
      # console.log "#{index}: #{key}: #{value}" for key, value of index for index in shows
      for item in shows when item.show.ids.trakt == opt.showID
        for season in item.seasons when not opt.seasonNumber? or season.number == opt.seasonNumber
          for episode in season.episodes when not opt.episodeNumber? or episode.number == opt.episodeNumber
            episode.completed = opt.completed
            console.log "Marking as seen #{item.show.title} S#{season.number}E#{episode.number}, #{episode.completed}"
      success()
    (response, status, req) ->
      console.log "Check FAILURE"
