only scan once per day

This commit is contained in:
j 2019-02-01 16:43:05 +05:30
parent a27ef9701f
commit 853f6cdc0c

View file

@ -36,7 +36,10 @@ class Tasks(Thread):
def run(self): def run(self):
self.load_tasks() self.load_tasks()
self.queue('scan') if time.mktime(time.gmtime()) - settings.server.get('last_scan', 0) > 24*60*60:
settings.server['last_scan'] = time.mktime(time.gmtime())
self.queue('scan')
import item.scan import item.scan
from item.models import sync_metadata, get_preview, get_cover from item.models import sync_metadata, get_preview, get_cover
from user.models import ( from user.models import (