diff --git a/CHANGES.md b/CHANGES.md
index 2f536bfb..062f04af 100644
--- a/CHANGES.md
+++ b/CHANGES.md
@@ -21,7 +21,7 @@
* Fix imdb and three other images rejected by IExplorer because they were corrupt. Turns out that they were .ico files renamed to either .gif or .png instead of being properly converted
* Fix "Subtitle Language" drop down font colour when entering text on the Subtitles Search settings
* Clean up text, correct quotations, use spaces for code lines, tabs for html
-* Update changelog
+* Implement automatic saving of poster layout sorting options on show list
### 0.2.1 (2014-10-22 06:41:00 UTC)
diff --git a/gui/slick/interfaces/default/home.tmpl b/gui/slick/interfaces/default/home.tmpl
index 6c866b7d..f193ce7e 100644
--- a/gui/slick/interfaces/default/home.tmpl
+++ b/gui/slick/interfaces/default/home.tmpl
@@ -151,8 +151,8 @@
jQuery.each(\$container, function (j) {
this.isotope({
itemSelector: '.show',
- sortBy : 'name',
- sortAscending: 'true',
+ sortBy : '$sickbeard.POSTER_SORTBY',
+ sortAscending: $sickbeard.POSTER_SORTDIR,
layoutMode: 'masonry',
masonry: {
columnWidth: 12,
@@ -168,13 +168,9 @@
#end if
},
network: '[data-network]',
- date: function( itemElem ) {
+ date: function( itemElem ) {
var date = \$( itemElem ).attr('data-date');
- if (sortDirection = 'true') {
- return date.length && parseInt( date, 10 ) || Number.POSITIVE_INFINITY;
- } else {
- return date.length && parseInt( date, 10 ) * -1 || Number.POSITIVE_INFINITY;
- }
+ return date.length && parseInt( date, 10 ) || Number.POSITIVE_INFINITY;
},
progress: function( itemElem ) {
var progress = \$( itemElem ).attr('data-progress');
@@ -188,6 +184,7 @@
var sortValue = this.value;
\$('#container').isotope({ sortBy: sortValue });
\$('#container-anime').isotope({ sortBy: sortValue });
+ \$.get(this.options[this.selectedIndex].getAttribute('data-sort'));
});
\$('#postersortdirection').on( 'change', function() {
@@ -195,6 +192,7 @@
sortDirection = sortDirection == 'true';
\$('#container').isotope({ sortAscending: sortDirection });
\$('#container-anime').isotope({ sortAscending: sortDirection });
+ \$.get(this.options[this.selectedIndex].getAttribute('data-sort'));
});
});
@@ -222,17 +220,17 @@
Sort By:
Sort Order:
diff --git a/sickbeard/__init__.py b/sickbeard/__init__.py
index 06d5c1fc..17a7945a 100755
--- a/sickbeard/__init__.py
+++ b/sickbeard/__init__.py
@@ -428,6 +428,8 @@ TIME_PRESET = None
TIME_PRESET_W_SECONDS = None
TIMEZONE_DISPLAY = None
THEME_NAME = None
+POSTER_SORTBY = None
+POSTER_SORTDIR = None
USE_SUBTITLES = False
SUBTITLES_LANGUAGES = []
@@ -496,6 +498,7 @@ def initialize(consoleLogging=True):
USE_LISTVIEW, METADATA_XBMC, METADATA_XBMC_12PLUS, METADATA_MEDIABROWSER, METADATA_PS3, metadata_provider_dict, \
NEWZBIN, NEWZBIN_USERNAME, NEWZBIN_PASSWORD, GIT_PATH, MOVE_ASSOCIATED_FILES, POSTPONE_IF_SYNC_FILES, dailySearchScheduler, NFO_RENAME, \
GUI_NAME, HOME_LAYOUT, HISTORY_LAYOUT, DISPLAY_SHOW_SPECIALS, COMING_EPS_LAYOUT, COMING_EPS_SORT, COMING_EPS_DISPLAY_PAUSED, COMING_EPS_MISSED_RANGE, FUZZY_DATING, TRIM_ZERO, DATE_PRESET, TIME_PRESET, TIME_PRESET_W_SECONDS, THEME_NAME, \
+ POSTER_SORTBY, POSTER_SORTDIR, \
METADATA_WDTV, METADATA_TIVO, METADATA_MEDE8ER, IGNORE_WORDS, REQUIRE_WORDS, CALENDAR_UNPROTECTED, CREATE_MISSING_SHOW_DIRS, \
ADD_SHOWS_WO_DIR, USE_SUBTITLES, SUBTITLES_LANGUAGES, SUBTITLES_DIR, SUBTITLES_SERVICES_LIST, SUBTITLES_SERVICES_ENABLED, SUBTITLES_HISTORY, SUBTITLES_FINDER_FREQUENCY, subtitlesFinderScheduler, \
USE_FAILED_DOWNLOADS, DELETE_FAILED, ANON_REDIRECT, LOCALHOST_IP, TMDB_API_KEY, DEBUG, PROXY_SETTING, PROXY_INDEXERS, \
@@ -946,6 +949,8 @@ def initialize(consoleLogging=True):
TIME_PRESET_W_SECONDS = check_setting_str(CFG, 'GUI', 'time_preset', '%I:%M:%S %p')
TIME_PRESET = TIME_PRESET_W_SECONDS.replace(u":%S", u"")
TIMEZONE_DISPLAY = check_setting_str(CFG, 'GUI', 'timezone_display', 'network')
+ POSTER_SORTBY = check_setting_str(CFG, 'GUI', 'poster_sortby', 'name')
+ POSTER_SORTDIR = check_setting_int(CFG, 'GUI', 'poster_sortdir', 1)
# initialize NZB and TORRENT providers
providerList = providers.makeProviderList()
@@ -1762,6 +1767,8 @@ def save_config():
new_config['GUI']['date_preset'] = DATE_PRESET
new_config['GUI']['time_preset'] = TIME_PRESET_W_SECONDS
new_config['GUI']['timezone_display'] = TIMEZONE_DISPLAY
+ new_config['GUI']['poster_sortby'] = POSTER_SORTBY
+ new_config['GUI']['poster_sortdir'] = POSTER_SORTDIR
new_config['Subtitles'] = {}
new_config['Subtitles']['use_subtitles'] = int(USE_SUBTITLES)
diff --git a/sickbeard/webserve.py b/sickbeard/webserve.py
index 931cec8c..eec0d2f9 100644
--- a/sickbeard/webserve.py
+++ b/sickbeard/webserve.py
@@ -290,6 +290,19 @@ class MainHandler(RequestHandler):
redirect("/home/")
+ def setPosterSortBy(self, sort):
+
+ if sort not in ('name', 'date', 'network', 'progress'):
+ sort = 'name'
+
+ sickbeard.POSTER_SORTBY = sort
+ sickbeard.save_config()
+
+ def setPosterSortDir(self, direction):
+
+ sickbeard.POSTER_SORTDIR = int(direction)
+ sickbeard.save_config()
+
def setHistoryLayout(self, layout):
if layout not in ('compact', 'detailed'):