diff --git a/bazarr.py b/bazarr.py index 660eb398c..bea01bd84 100644 --- a/bazarr.py +++ b/bazarr.py @@ -149,7 +149,7 @@ def series(): offset = (int(page) - 1) * 15 max_page = int(math.ceil(missing_count / 15.0)) - c.execute("SELECT tvdbId, title, path_substitution(path), languages, hearing_impaired, sonarrSeriesId, poster, audio_language FROM table_shows ORDER BY title ASC LIMIT 15 OFFSET ?", (offset,)) + c.execute("SELECT tvdbId, title, path_substitution(path), languages, hearing_impaired, sonarrSeriesId, poster, audio_language FROM table_shows ORDER BY sortTitle ASC LIMIT 15 OFFSET ?", (offset,)) data = c.fetchall() c.execute("SELECT code2, name FROM table_settings_languages WHERE enabled = 1") languages = c.fetchall() diff --git a/get_series.py b/get_series.py index 8f663282b..83471ab13 100644 --- a/get_series.py +++ b/get_series.py @@ -48,9 +48,9 @@ def update_series(): # Update or insert shows list in database table try: - c.execute('''INSERT INTO table_shows(title, path, tvdbId, languages,`hearing_impaired`, sonarrSeriesId, overview, poster, fanart, `audio_language`) VALUES (?,?,?,(SELECT languages FROM table_shows WHERE tvdbId = ?),(SELECT `hearing_impaired` FROM table_shows WHERE tvdbId = ?), ?, ?, ?, ?, ?)''', (show["title"], show["path"], show["tvdbId"], show["tvdbId"], show["tvdbId"], show["id"], overview, poster, fanart, profile_id_to_language(show['qualityProfileId']))) + c.execute('''INSERT INTO table_shows(title, path, tvdbId, languages,`hearing_impaired`, sonarrSeriesId, overview, poster, fanart, `audio_language`, sortTitle) VALUES (?,?,?,(SELECT languages FROM table_shows WHERE tvdbId = ?),(SELECT `hearing_impaired` FROM table_shows WHERE tvdbId = ?), ?, ?, ?, ?, ?, ?)''', (show["title"], show["path"], show["tvdbId"], show["tvdbId"], show["tvdbId"], show["id"], overview, poster, fanart, profile_id_to_language(show['qualityProfileId']), show['sortTitle'])) except: - c.execute('''UPDATE table_shows SET title = ?, path = ?, tvdbId = ?, sonarrSeriesId = ?, overview = ?, poster = ?, fanart = ?, `audio_language` = ? WHERE tvdbid = ?''', (show["title"],show["path"],show["tvdbId"],show["id"],overview,poster,fanart,profile_id_to_language((show['qualityProfileId'] if sonarr_version == 2 else show['languageProfileId'])),show["tvdbId"])) + c.execute('''UPDATE table_shows SET title = ?, path = ?, tvdbId = ?, sonarrSeriesId = ?, overview = ?, poster = ?, fanart = ?, `audio_language` = ? , sortTitle = ? WHERE tvdbid = ?''', (show["title"],show["path"],show["tvdbId"],show["id"],overview,poster,fanart,profile_id_to_language((show['qualityProfileId'] if sonarr_version == 2 else show['languageProfileId'])),show['sortTitle'],show["tvdbId"])) # Delete shows not in Sonarr anymore deleted_items = [] diff --git a/update_db.py b/update_db.py index 389880bc6..f828adc9d 100644 --- a/update_db.py +++ b/update_db.py @@ -82,6 +82,11 @@ if os.path.exists(os.path.join(os.path.dirname(__file__), 'data/db/bazarr.db')) else: c.execute('UPDATE table_settings_sonarr SET full_update="Daily"') + try: + c.execute('alter table table_shows add column "sortTitle" "text"') + except: + pass + # Commit change to db db.commit() diff --git a/views/series.tpl b/views/series.tpl index f2b9227ad..022fc1797 100644 --- a/views/series.tpl +++ b/views/series.tpl @@ -3,7 +3,6 @@ - @@ -52,15 +51,15 @@
- +
- + - + @@ -202,8 +201,6 @@ sessionStorage.clear(); } - $('table').tablesort(); - $('a, button:not(.cancel)').click(function(){ $('#loader').addClass('active'); })
NameName Path Audio language Subtitles languages Hearing-impaired