Skip to content

Commit

Permalink
Merge pull request #1017 from philborman/master
Browse files Browse the repository at this point in the history
Goodreads sync tweaks, message changes
  • Loading branch information
philborman authored Aug 31, 2017
2 parents d51d4df + 62bbc15 commit 76825d7
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 9 deletions.
4 changes: 2 additions & 2 deletions data/interfaces/bookstrap/config.html
Original file line number Diff line number Diff line change
Expand Up @@ -353,9 +353,9 @@ <h1>${title}</h1>
<label for="gr_oauth_secret">Goodreads OAuth Secret:</label>
<input type="text" id="gr_oauth_secret" name="gr_oauth_secret" value="${lazylibrarian.CONFIG['GR_OAUTH_SECRET']}" class="form-control">
<label for="gr_wanted">Sync Wanted to Goodreads shelf:</label>
<input type="text" id="gr_wanted" name="gr_wanted" value="${lazylibrarian.CONFIG['GR_WANTED']}" class="form-control">
<input type="text" id="gr_wanted" name="gr_wanted" value="${lazylibrarian.CONFIG['GR_WANTED']}" class="form-control" placeholder="eg: to-read">
<label for="gr_owned">Sync Open/Have to Goodreads shelf:</label>
<input type="text" id="gr_owned" name="gr_owned" value="${lazylibrarian.CONFIG['GR_OWNED']}" class="form-control">
<input type="text" id="gr_owned" name="gr_owned" value="${lazylibrarian.CONFIG['GR_OWNED']}" class="form-control" placeholder="eg: owned">
<div class="form-group">
<label for="goodreads_interval" class="control-label">Goodreads Sync Interval:</label>
<div class="input-group">
Expand Down
4 changes: 2 additions & 2 deletions lazylibrarian/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
13 changes: 9 additions & 4 deletions lazylibrarian/grsync.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion lazylibrarian/webServe.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 76825d7

Please sign in to comment.