export library.json into data, fixes #82
This commit is contained in:
parent
d0a9515cc0
commit
bae70fd829
2 changed files with 8 additions and 1 deletions
|
@ -28,7 +28,7 @@ class Downloads(Thread):
|
||||||
if now > settings.server.get('last_update_check', 0) + 24*60*60:
|
if now > settings.server.get('last_update_check', 0) + 24*60*60:
|
||||||
settings.server['last_update_check'] = now
|
settings.server['last_update_check'] = now
|
||||||
update.download()
|
update.download()
|
||||||
state.user().library.export_json()
|
state.user().export_library()
|
||||||
|
|
||||||
def download_next(self):
|
def download_next(self):
|
||||||
import item.models
|
import item.models
|
||||||
|
|
|
@ -92,6 +92,13 @@ class User(db.Model):
|
||||||
j['name'] = self.name
|
j['name'] = self.name
|
||||||
return j
|
return j
|
||||||
|
|
||||||
|
def export_library(self):
|
||||||
|
old_path = os.path.join(os.path.expanduser(settings.preferences['libraryPath']), 'Books', 'library.json')
|
||||||
|
if os.path.exists(old_path):
|
||||||
|
os.unlink(old_path)
|
||||||
|
path = os.path.join(settings.data_path, 'library.json')
|
||||||
|
self.library.export_json(path)
|
||||||
|
|
||||||
def is_online(self):
|
def is_online(self):
|
||||||
return state.nodes and state.nodes.is_online(self.id)
|
return state.nodes and state.nodes.is_online(self.id)
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue