From 62bbc157db6cb4097530ba26bbe5cec8622af8fd Mon Sep 17 00:00:00 2001 From: Phil Borman Date: Thu, 31 Aug 2017 10:28:54 +0200 Subject: [PATCH] Goodreads sync tweaks, message changes --- data/interfaces/bookstrap/config.html | 4 ++-- lazylibrarian/__init__.py | 4 ++-- lazylibrarian/grsync.py | 13 +++++++++---- lazylibrarian/webServe.py | 2 +- 4 files changed, 14 insertions(+), 9 deletions(-) diff --git a/data/interfaces/bookstrap/config.html b/data/interfaces/bookstrap/config.html index b59254f8d..d18dc0917 100644 --- a/data/interfaces/bookstrap/config.html +++ b/data/interfaces/bookstrap/config.html @@ -353,9 +353,9 @@

${title}

- + - +
diff --git a/lazylibrarian/__init__.py b/lazylibrarian/__init__.py index 8391c042c..0b1246a7e 100644 --- a/lazylibrarian/__init__.py +++ b/lazylibrarian/__init__.py @@ -388,8 +388,8 @@ 'GR_SECRET': ('str', 'API', ''), # tied to users own api key 'GR_OAUTH_TOKEN': ('str', 'API', ''), # gives access to users bookshelves 'GR_OAUTH_SECRET': ('str', 'API', ''), # gives access to users bookshelves - 'GR_WANTED': ('str', 'API', 'to-read'), # sync wanted to this shelf - 'GR_OWNED': ('str', 'API', 'owned'), # sync open/have to this shelf + 'GR_WANTED': ('str', 'API', ''), # sync wanted to this shelf + 'GR_OWNED': ('str', 'API', ''), # sync open/have to this shelf 'GR_FOLLOW': ('bool', 'API', 0), # follow authors on goodreads 'GR_FOLLOWNEW': ('bool', 'API', 0), # follow new authors on goodreads 'GB_API': ('str', 'API', '') # API key has daily limits, each user needs their own diff --git a/lazylibrarian/grsync.py b/lazylibrarian/grsync.py index b21801171..db79012a7 100644 --- a/lazylibrarian/grsync.py +++ b/lazylibrarian/grsync.py @@ -401,14 +401,19 @@ def test_auth(): def sync_to_gr(): to_read_shelf = to_owned_shelf = ll_wanted = ll_have = 0 + msg = '' if lazylibrarian.CONFIG['GR_WANTED']: to_read_shelf, ll_wanted = grsync('Wanted', lazylibrarian.CONFIG['GR_WANTED']) + msg += "%s added to %s shelf\n" % (to_read_shelf, lazylibrarian.CONFIG['GR_WANTED']) + msg += "%s marked Wanted\n" % ll_wanted + else: + msg += "Sync Wanted books is disabled\n" if lazylibrarian.CONFIG['GR_OWNED']: to_owned_shelf, ll_have = grsync('Open', lazylibrarian.CONFIG['GR_OWNED']) - msg = "%s added to %s shelf\n" % (to_read_shelf, lazylibrarian.CONFIG['GR_WANTED']) - msg += "%s added to %s shelf\n" % (to_owned_shelf, lazylibrarian.CONFIG['GR_OWNED']) - msg += "%s marked Wanted\n" % ll_wanted - msg += "%s marked Have" % ll_have + msg += "%s added to %s shelf\n" % (to_owned_shelf, lazylibrarian.CONFIG['GR_OWNED']) + msg += "%s marked Owned\n" % ll_have + else: + msg += "Sync Owned books is disabled\n" logger.info(msg) return msg diff --git a/lazylibrarian/webServe.py b/lazylibrarian/webServe.py index 585b2ff09..d272a9c49 100644 --- a/lazylibrarian/webServe.py +++ b/lazylibrarian/webServe.py @@ -2106,7 +2106,7 @@ def toggleLog(self): # 1 normal # 2 debug # >2 extra debugging - + label_thread('LOGS') if lazylibrarian.LOGLEVEL > 1: lazylibrarian.LOGLEVEL -= 2 else: