match titles without episode/season

This commit is contained in:
j 2013-02-09 04:45:36 +00:00
parent 5d78c6cba8
commit a2fe1abcc7

View file

@ -660,6 +660,7 @@ pandora.ui.infoView = function(data) {
function parseTitle(title) {
var data = {title: title},
match = /(\(S(\d{2})E(\d{2})\))/.exec(title),
episode_match = /(.+) \(S01\) (.+)/.exec(title),
split;
if (match) {
data.season = parseInt(match[2], 10);
@ -667,6 +668,9 @@ pandora.ui.infoView = function(data) {
split = title.split(match[1]);
data.seriesTitle = split[0].trim();
data.episodeTitle = split[1].trim();
} else if (episode_match) {
data.seriesTitle = match[1].trim();
data.episodeTitle = match[2].trim();
}
return data;
}