scanner: Fixing review comments.
This commit is contained in:
parent
98bb35d4d1
commit
71618f840f
@ -61,7 +61,7 @@ class BaseLibraryProvider(object):
|
||||
def __init__(self, backend):
|
||||
self.backend = backend
|
||||
|
||||
# TODO: replace with search(query, exact=Ture, ...)
|
||||
# TODO: replace with search(query, exact=True, ...)
|
||||
def find_exact(self, query=None, uris=None):
|
||||
"""
|
||||
See :meth:`mopidy.core.LibraryController.find_exact`.
|
||||
@ -116,7 +116,7 @@ class BaseLibraryUpdateProvider(object):
|
||||
def add(self, track):
|
||||
"""Adds given track to library.
|
||||
|
||||
Overwrites any existing entry with same uri.
|
||||
Overwrites any existing track with same URI.
|
||||
|
||||
*MUST be implemented by subclass.*
|
||||
"""
|
||||
|
||||
@ -86,7 +86,7 @@ def main():
|
||||
if uri not in uris_library:
|
||||
uris_update.add(uri)
|
||||
|
||||
logging.info('Found %d new or changed tracks.', len(uris_update))
|
||||
logging.info('Found %d new or modified tracks.', len(uris_update))
|
||||
|
||||
def store(data):
|
||||
track = translator(data)
|
||||
@ -97,7 +97,7 @@ def main():
|
||||
logging.warning('Failed %s: %s', uri, error)
|
||||
logging.debug('Debug info for %s: %s', uri, debug)
|
||||
|
||||
logging.info('Scanning new and changed tracks.')
|
||||
logging.info('Scanning new and modified tracks.')
|
||||
# TODO: just pass the library in instead?
|
||||
scanner = Scanner(uris_update, store, debug)
|
||||
try:
|
||||
|
||||
@ -256,7 +256,7 @@ class FindFilesTest(unittest.TestCase):
|
||||
def test_file(self):
|
||||
files = self.find('blank.mp3')
|
||||
self.assertEqual(len(files), 1)
|
||||
self.assert_(files[0], path_to_data_dir('blank.mp3'))
|
||||
self.assertEqual(files[0], path_to_data_dir('blank.mp3'))
|
||||
|
||||
def test_names_are_bytestrings(self):
|
||||
is_bytes = lambda f: isinstance(f, bytes)
|
||||
@ -285,7 +285,7 @@ class FindUrisTest(unittest.TestCase):
|
||||
uris = self.find('blank.mp3')
|
||||
expected = path.path_to_uri(path_to_data_dir('blank.mp3'))
|
||||
self.assertEqual(len(uris), 1)
|
||||
self.assert_(uris[0], expected)
|
||||
self.assertEqual(uris[0], expected)
|
||||
|
||||
def test_ignores_hidden_dirs(self):
|
||||
self.assertEqual(self.find('.hidden'), [])
|
||||
|
||||
Loading…
Reference in New Issue
Block a user