From bb2d874d2b4578dfcfda477081642756cec45b31 Mon Sep 17 00:00:00 2001 From: Adam Date: Thu, 20 Nov 2014 19:03:27 +0800 Subject: [PATCH 01/35] Fix searches freezing due to unescaped ignored or required words Conflicts: CHANGES.md --- CHANGES.md | 1 + sickbeard/show_name_helpers.py | 8 ++++---- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index 7a289c4c..fa22f801 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -44,6 +44,7 @@ * Fix failing "Providers" link on Config/Search Settings/Episode Search * Change case of labels in General Config/Interface/Timezone * Split enabled from not enabled providers in the Configure Provider drop down on the Providers Options tab +* Fix searches freezing due to unescaped ignored or required words [develop changelog] * Fix typo for commit "ShowData handler" i.e. SHA-1:3eec217 diff --git a/sickbeard/show_name_helpers.py b/sickbeard/show_name_helpers.py index a50fe06f..888d9092 100644 --- a/sickbeard/show_name_helpers.py +++ b/sickbeard/show_name_helpers.py @@ -59,20 +59,20 @@ def filterBadReleases(name, parse=True): # if any of the bad strings are in the name then say no if sickbeard.IGNORE_WORDS: resultFilters.extend(sickbeard.IGNORE_WORDS.split(',')) - filters = [re.compile('(^|[\W_])%s($|[\W_])' % filter.strip(), re.I) for filter in resultFilters] + filters = [re.compile('(^|[\W_])%s($|[\W_])' % re.escape(filter.strip()), re.I) for filter in resultFilters] for regfilter in filters: if regfilter.search(name): - logger.log(u"Invalid scene release: " + name + " contains pattern: " + regfilter.pattern + ", ignoring it", + logger.log(u"Invalid scene release: " + name + " contained: " + regfilter.pattern + ", ignoring it", logger.DEBUG) return False # if any of the good strings aren't in the name then say no if sickbeard.REQUIRE_WORDS: require_words = sickbeard.REQUIRE_WORDS.split(',') - filters = [re.compile('(^|[\W_])%s($|[\W_])' % filter.strip(), re.I) for filter in require_words] + filters = [re.compile('(^|[\W_])%s($|[\W_])' % re.escape(filter.strip()), re.I) for filter in require_words] for regfilter in filters: if not regfilter.search(name): - logger.log(u"Invalid scene release: " + name + " doesn't contain pattern: " + regfilter.pattern + ", ignoring it", + logger.log(u"Invalid scene release: " + name + " didn't contain: " + regfilter.pattern + ", ignoring it", logger.DEBUG) return False From 711898aa46e78dffa4734fd0ea41af2a709043f4 Mon Sep 17 00:00:00 2001 From: Adam Date: Sat, 22 Nov 2014 22:15:27 +0800 Subject: [PATCH 02/35] Add failed database to unit tests tear down function Fix purging of database files in tear down function during unit tests --- CHANGES.md | 2 ++ tests/test_lib.py | 16 +++++++++++----- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index fa22f801..3f7b34d8 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -45,6 +45,8 @@ * Change case of labels in General Config/Interface/Timezone * Split enabled from not enabled providers in the Configure Provider drop down on the Providers Options tab * Fix searches freezing due to unescaped ignored or required words +* Add failed database to unit tests tear down function +* Fix purging of database files in tear down function during unit tests [develop changelog] * Fix typo for commit "ShowData handler" i.e. SHA-1:3eec217 diff --git a/tests/test_lib.py b/tests/test_lib.py index 43d87eaa..ba2139e0 100644 --- a/tests/test_lib.py +++ b/tests/test_lib.py @@ -34,7 +34,7 @@ import shutil from sickbeard import encodingKludge as ek, providers, tvcache from sickbeard import db from sickbeard.databases import mainDB -from sickbeard.databases import cache_db +from sickbeard.databases import cache_db, failed_db #================= # test globals @@ -42,7 +42,7 @@ from sickbeard.databases import cache_db TESTDIR = os.path.abspath('.') TESTDBNAME = "sickbeard.db" TESTCACHEDBNAME = "cache.db" - +TESTFAILEDDBNAME = "failed.db" SHOWNAME = u"show name" SEASON = 4 @@ -102,6 +102,7 @@ createTestCacheFolder() #================= def _dummy_saveConfig(): return True + # this overrides the sickbeard save_config which gets called during a db upgrade # this might be considered a hack mainDB.sickbeard.save_config = _dummy_saveConfig @@ -165,7 +166,6 @@ class TestCacheDBConnection(TestDBConnection, object): sickbeard.db.DBConnection = TestDBConnection sickbeard.tvcache.CacheDBConnection = TestCacheDBConnection - #================= # test functions #================= @@ -174,23 +174,29 @@ def setUp_test_db(): """ # upgrading the db db.upgradeDatabase(db.DBConnection(), mainDB.InitialSchema) + # fix up any db problems db.sanityCheckDatabase(db.DBConnection(), mainDB.MainSanityCheck) - #and for cache.b too + # and for cachedb too db.upgradeDatabase(db.DBConnection("cache.db"), cache_db.InitialSchema) + # and for faileddb too + db.upgradeDatabase(db.DBConnection("failed.db"), failed_db.InitialSchema) + def tearDown_test_db(): """Deletes the test db although this seams not to work on my system it leaves me with an zero kb file """ # uncomment next line so leave the db intact between test and at the end - return False + #return False if os.path.exists(os.path.join(TESTDIR, TESTDBNAME)): os.remove(os.path.join(TESTDIR, TESTDBNAME)) if os.path.exists(os.path.join(TESTDIR, TESTCACHEDBNAME)): os.remove(os.path.join(TESTDIR, TESTCACHEDBNAME)) + if os.path.exists(os.path.join(TESTDIR, TESTFAILEDDBNAME)): + os.remove(os.path.join(TESTDIR, TESTFAILEDDBNAME)) def setUp_test_episode_file(): From 2de69d028b3816341abf2ce3f40f9a154b8236db Mon Sep 17 00:00:00 2001 From: JackDandy Date: Sat, 22 Nov 2014 17:02:22 +0000 Subject: [PATCH 03/35] Add auto focus to home page Search Show box. Add ability to auto focus on Show List/Layout:Simple when page is refreshed, can control this option via General Config/Interface. --- CHANGES.md | 3 +- gui/slick/css/dark.css | 4 - gui/slick/css/light.css | 4 - gui/slick/css/style.css | 10 +- .../interfaces/default/config_general.tmpl | 10 + gui/slick/interfaces/default/home.tmpl | 43 ++-- gui/slick/interfaces/default/inc_top.tmpl | 206 +++++++++--------- sickbeard/__init__.py | 5 +- sickbeard/webserve.py | 3 +- 9 files changed, 153 insertions(+), 135 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index 3f7b34d8..dd1a0070 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -43,10 +43,11 @@ * Fix failing "Search Settings" link that is shown on Config/Search Providers when Torrents Search is not enabled * Fix failing "Providers" link on Config/Search Settings/Episode Search * Change case of labels in General Config/Interface/Timezone -* Split enabled from not enabled providers in the Configure Provider drop down on the Providers Options tab +* Split enabled from not enabled providers in the Configure Provider drop down on the Providers Options tab * Fix searches freezing due to unescaped ignored or required words * Add failed database to unit tests tear down function * Fix purging of database files in tear down function during unit tests +* Add ability to auto focus Search Show box on Home page and control this option via General Config/Interface [develop changelog] * Fix typo for commit "ShowData handler" i.e. SHA-1:3eec217 diff --git a/gui/slick/css/dark.css b/gui/slick/css/dark.css index d72fb0cf..1a86350b 100644 --- a/gui/slick/css/dark.css +++ b/gui/slick/css/dark.css @@ -538,10 +538,6 @@ home.tmpl margin-right: 5px; } -.search { - margin-bottom: 10px; -} - .ui-progressbar { height: 20px; line-height: 18px; diff --git a/gui/slick/css/light.css b/gui/slick/css/light.css index a110113c..01d2dfea 100644 --- a/gui/slick/css/light.css +++ b/gui/slick/css/light.css @@ -525,10 +525,6 @@ home.tmpl margin-right: 5px; } -.search { - margin-bottom: 10px; -} - .ui-progressbar { height: 20px; line-height: 18px; diff --git a/gui/slick/css/style.css b/gui/slick/css/style.css index 5a3870a8..447cc9fb 100644 --- a/gui/slick/css/style.css +++ b/gui/slick/css/style.css @@ -535,9 +535,13 @@ home.tmpl margin-right: 5px; } -.search { - margin-bottom: 10px; -} +#HomeLayout { margin-top: -35px; } +#HomeLayout.not-poster { height: 75px } +#HomeLayout div.not-poster { position:relative; top:38px; } +#HomeLayout span.not-poster { margin-top: -30px } +#HomeLayout.poster { margin-top: -35px; } +#HomeLayout span.poster { margin-bottom:10px } +#search_show_name { margin-top: 0 } .ui-progressbar { height: 20px; diff --git a/gui/slick/interfaces/default/config_general.tmpl b/gui/slick/interfaces/default/config_general.tmpl index 756d4d03..b5d186f9 100644 --- a/gui/slick/interfaces/default/config_general.tmpl +++ b/gui/slick/interfaces/default/config_general.tmpl @@ -215,6 +215,16 @@ +
+ +
+