Ensure that scanner does not die on non-existant folders
This commit is contained in:
parent
2ebaa38ed9
commit
d9d393ac21
@ -99,8 +99,9 @@ class Scanner(object):
|
||||
self.pipe.set_state(gst.STATE_PAUSED)
|
||||
|
||||
def start(self):
|
||||
self.next_uri()
|
||||
self.loop.run()
|
||||
if self.uris:
|
||||
self.next_uri()
|
||||
self.loop.run()
|
||||
|
||||
def stop(self):
|
||||
self.pipe.set_state(gst.STATE_NULL)
|
||||
|
||||
@ -90,6 +90,10 @@ class ScannerTest(unittest.TestCase):
|
||||
self.scan('scanner/simple')
|
||||
self.check('scanner/simple/song1.mp3', 'title', 'trackname')
|
||||
|
||||
def test_nonexistant_folder_does_not_fail(self):
|
||||
self.scan('scanner/does-not-exist')
|
||||
self.assert_(not self.errors)
|
||||
|
||||
def test_other_media_is_ignored(self):
|
||||
self.scan('scanner/image')
|
||||
self.assert_(self.errors)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user