emmental/scanner/__init__.py
Anna Schumaker 328dce0be2 scanner: Fix scanner.update_library() function
We were scheduling the CheckTask, but not following up with a
DirectoryTask to scan for new files. I use this function during the
Gtk.Application startup to automatically update the libraries.

Implements #31 (Automatically update the database during startup)
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2021-12-28 15:50:11 -05:00

38 lines
817 B
Python

# Copyright 2021 (c) Anna Schumaker.
from . import metadata
from . import queue
from . import task
from . import widgets
Queue = queue.TaskQueue()
def ProgressBar():
return widgets.ProgressBar(Queue)
def AddFolderButton():
return widgets.AddFolderButton(Queue)
def UpdateButton(library):
return widgets.UpdateButton(library, Queue)
def UpdateAllButton():
return widgets.UpdateAllButton(Queue)
def RemoveButton(library):
return widgets.RemoveButton(library, Queue)
def EnableSwitch(library):
return widgets.EnableSwitch(library, Queue)
def commit():
Queue.push(task.CommitTask())
def update_library(lib):
Queue.push(task.CheckSchedulerTask(lib))
Queue.push(task.DirectoryTask(lib, lib.path))
def remove_library(lib):
Queue.push(task.RemoveLibrarySchedulerTask(lib))