Compare commits
2 commits
7220fb4cdd
...
f104a688f2
| Author | SHA1 | Date | |
|---|---|---|---|
| f104a688f2 | |||
| fb04c9fef0 |
2 changed files with 9 additions and 2 deletions
|
|
@ -195,14 +195,19 @@ def run_scan():
|
|||
if len(ids) != len(books):
|
||||
logger.debug('number of books %s vs number of ids %s', len(books), len(ids))
|
||||
if library_items != len(books):
|
||||
logger.debug('number of books %s vs number of items in library %s', len(books), library_items)
|
||||
library_items = set([str(i) for i in user.library.items])
|
||||
gone = library_items - ids
|
||||
first = True
|
||||
if gone:
|
||||
for id in gone:
|
||||
i = Item.get(id)
|
||||
if i.info.get('mediastate') == 'transferring':
|
||||
continue
|
||||
path = i.get_path()
|
||||
if not path or not os.path.exists(path):
|
||||
if first:
|
||||
logger.debug('number of books %s vs number of items in library %s', len(books), library_items)
|
||||
first = False
|
||||
logger.debug('cleaning orphaned record %s %s', i, path)
|
||||
i.remove_file()
|
||||
missing = ids - library_items
|
||||
|
|
|
|||
|
|
@ -155,7 +155,9 @@ class Tor(object):
|
|||
self.controller.add_event_listener(self.event_listener)
|
||||
self.controller.add_status_listener(self.status_listener)
|
||||
self.connected = True
|
||||
self.socks_port = int(self.controller.get_conf('SocksPort').split(' ')[0])
|
||||
port = self.controller.get_conf('SocksPort')
|
||||
if port:
|
||||
self.socks_port = int(port.split(' ')[0])
|
||||
self.publish()
|
||||
state.online = self.is_online()
|
||||
return True
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue