{"action":"opened","issue":{"url":"https://api.github.com/repos/tegon/traktflix/issues/26","repository_url":"https://api.github.com/repos/tegon/traktflix","labels_url":"https://api.github.com/repos/tegon/traktflix/issues/26/labels{/name}","comments_url":"https://api.github.com/repos/tegon/traktflix/issues/26/comments","events_url":"https://api.github.com/repos/tegon/traktflix/issues/26/events","html_url":"https://github.com/tegon/traktflix/issues/26","id":133284748,"number":26,"title":"Viewing Activity Parser - error with some titles","user":{"login":"some-guy-23","id":16366381,"avatar_url":"https://avatars.githubusercontent.com/u/16366381?v=3","gravatar_id":"","url":"https://api.github.com/users/some-guy-23","html_url":"https://github.com/some-guy-23","followers_url":"https://api.github.com/users/some-guy-23/followers","following_url":"https://api.github.com/users/some-guy-23/following{/other_user}","gists_url":"https://api.github.com/users/some-guy-23/gists{/gist_id}","starred_url":"https://api.github.com/users/some-guy-23/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/some-guy-23/subscriptions","organizations_url":"https://api.github.com/users/some-guy-23/orgs","repos_url":"https://api.github.com/users/some-guy-23/repos","events_url":"https://api.github.com/users/some-guy-23/events{/privacy}","received_events_url":"https://api.github.com/users/some-guy-23/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2016-02-12T16:32:51Z","updated_at":"2016-02-12T16:32:51Z","closed_at":null,"body":"Just installed this extension, and on running the sync the first time the progress spinner kept going until I clicked on something else. I dug into it, and narrowed down the issue to this line in the parser -\r\n\r\nhttps://github.com/tegon/traktflix/blob/master/app/scripts/src/content/viewing-activity-parser.js#L25\r\n\r\nIt was getting to the episode title, with a NULL splittedTitle[1], which caused trim() to blow up.\r\n\r\nI pulled open my results for the API call to viewing activity to see what could be causing this. The problem is caused specifically by a case where the series title doesn't have the season in title, but does have a number. For example for the TV show Ascension -\r\n\r\n> \"\"Chapter One, Part 1\"\"\r\n\r\nHere the script splits on \":\", which does not exist. So, the entire title is included in splittedTitle[0]. At this point, it parses the \"1\" as the season. Then, it caries on to get splittedTitle[1], which does not exist. Hopefully this info helps!"}}