scanner: Create a commit() shortcut function
For scheduling a commit task Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
This commit is contained in:
parent
3afaea664b
commit
b8da049be9
|
@ -23,6 +23,9 @@ def RemoveButton(library):
|
|||
return widgets.RemoveButton(library, Queue)
|
||||
|
||||
|
||||
def commit():
|
||||
Queue.push(task.CommitTask())
|
||||
|
||||
def import_track(lib, track, playcount, lastplayed):
|
||||
Queue.push(task.ImportTask(lib, track, playcount, lastplayed))
|
||||
|
||||
|
|
|
@ -32,6 +32,10 @@ class TestScanner(unittest.TestCase):
|
|||
self.assertIsInstance(scanner.Queue.tasks[0],
|
||||
scanner.task.RemoveLibrarySchedulerTask)
|
||||
|
||||
def test_scanner_commit(self):
|
||||
scanner.commit()
|
||||
self.assertIsInstance(scanner.Queue.tasks[0], scanner.task.CommitTask)
|
||||
|
||||
def test_scanner_widgets(self):
|
||||
lib = db.library.Table.find(test_album)
|
||||
|
||||
|
|
Loading…
Reference in New Issue