Skip to content

Commit

Permalink
Message changes
Browse files Browse the repository at this point in the history
  • Loading branch information
philborman committed Jun 2, 2018
1 parent bbb8868 commit be4e47e
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 10 deletions.
2 changes: 1 addition & 1 deletion lazylibrarian/formatter.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ def next_run(when_run):
td = when_run - timenow
diff = td.seconds # time difference in seconds
except ValueError as e:
logger.error("Error getting next run for [%s] %s" % (when_run, str(e)))
lazylibrarian.logger.error("Error getting next run for [%s] %s" % (when_run, str(e)))
diff = 0

# calculate whole units, plus round up by adding 1(true) if remainder >= half
Expand Down
14 changes: 7 additions & 7 deletions lazylibrarian/qbittorrent.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,26 +11,26 @@
# along with Lazylibrarian. If not, see <http://www.gnu.org/licenses/>.


import json
import mimetypes
import os
import platform
import random
import string
import time

import lazylibrarian
from lazylibrarian import logger
from lazylibrarian.common import USER_AGENT
from lazylibrarian.formatter import check_int, getList, makeBytestr, makeUnicode
# noinspection PyUnresolvedReferences
from lib.six.moves import http_cookiejar
# noinspection PyUnresolvedReferences
from lib.six.moves.urllib_error import URLError
# noinspection PyUnresolvedReferences
from lib.six.moves.urllib_parse import urlencode
# noinspection PyUnresolvedReferences
from lib.six.moves.urllib_request import HTTPCookieProcessor, build_opener, Request
# noinspection PyUnresolvedReferences
from lib.six.moves.urllib_error import URLError

import lazylibrarian
from lazylibrarian import logger
from lazylibrarian.common import USER_AGENT
from lazylibrarian.formatter import check_int, getList, makeBytestr, makeUnicode


class qbittorrentclient(object):
Expand Down
5 changes: 3 additions & 2 deletions lazylibrarian/rssfeed.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
import datetime

from lazylibrarian import logger, database
from lazylibrarian.formatter import plural
from lib.rfeed import Item, Guid, Feed


Expand All @@ -38,7 +39,7 @@ def genFeed(ftype, limit=10, user=0, baseurl=''):
myDB = database.DBConnection()
results = myDB.select(cmd)
items = []
logger.debug("Found %s %s results" % (len(results), ftype))
# logger.debug("Found %s %s results" % (len(results), ftype))

for res in results:
link = ''
Expand Down Expand Up @@ -87,5 +88,5 @@ def genFeed(ftype, limit=10, user=0, baseurl=''):
language="en-US",
lastBuildDate=datetime.datetime.now(),
items=items)
logger.debug("Returning %s feed items" % len(items))
logger.debug("Returning %s %s%s" % (len(items), ftype, plural(len(items))))
return feed.rss()
3 changes: 3 additions & 0 deletions lazylibrarian/webServe.py
Original file line number Diff line number Diff line change
Expand Up @@ -3406,6 +3406,7 @@ def importAlternate(self):

@cherrypy.expose
def rssFeed(self, **kwargs):
self.label_thread('RSSFEED')
if 'type' in kwargs:
ftype = kwargs['type']
else:
Expand Down Expand Up @@ -3438,6 +3439,8 @@ def rssFeed(self, **kwargs):
pass
path = path.replace('rssFeed', '').rstrip('/')
baseurl = urlunsplit((scheme, netloc, path, qs, anchor))
remote_ip = cherrypy.request.remote.ip
logger.info("RSS Feed request %s %s%s for %s" % (limit, ftype, plural(limit), remote_ip))
return genFeed(ftype, limit=limit, user=userid, baseurl=baseurl)

@cherrypy.expose
Expand Down

0 comments on commit be4e47e

Please sign in to comment.