diff --git a/CHANGES.md b/CHANGES.md index c167f46c..f03a1a29 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -50,7 +50,7 @@ * Fix reduces time API endpoint Shows takes to return results * Fix Coming Eps Page to include shows +/- 1 day for time zone corrections * Fix season jumping dropdown menu for shows with over 15 seasons on Display Show -* Fix article sorting for Coming Eps, Manage, Show List, and Trending Shows +* Fix article sorting for Coming Eps, Manage, Show List, Display Show, API, and Trending Shows pages ### 0.3.1 (2014-11-19 16:40:00 UTC) diff --git a/sickbeard/webapi.py b/sickbeard/webapi.py index 46496d0f..0051d23c 100644 --- a/sickbeard/webapi.py +++ b/sickbeard/webapi.py @@ -126,15 +126,7 @@ class Api(webserve.MainHandler): t = webserve.PageTemplate(headers=self.request.headers, file="apiBuilder.tmpl") def titler(x): - if not x or sickbeard.SORT_ARTICLE: - return x - if x.lower().startswith('a '): - x = x[2:] - elif x.lower().startswith('an '): - x = x[3:] - elif x.lower().startswith('the '): - x = x[4:] - return x + return (remove_article(x), x)[not x or sickbeard.SORT_ARTICLE] t.sortedShowList = sorted(sickbeard.showList, lambda x, y: cmp(titler(x.name), titler(y.name))) diff --git a/sickbeard/webserve.py b/sickbeard/webserve.py index dda6dcb2..b72c57cc 100644 --- a/sickbeard/webserve.py +++ b/sickbeard/webserve.py @@ -3759,15 +3759,7 @@ class Home(MainHandler): epCounts[curEpCat] += 1 def titler(x): - if not x or sickbeard.SORT_ARTICLE: - return x - if x.lower().startswith('a '): - x = x[2:] - if x.lower().startswith('an '): - x = x[3:] - elif x.lower().startswith('the '): - x = x[4:] - return x + return (remove_article(x), x)[not x or sickbeard.SORT_ARTICLE] if sickbeard.ANIME_SPLIT_HOME: shows = []