Merge pull request #1010 from RonaldZ/feature/scan_force_arg
local: Add --force flag to 'mopidy local scan' command
This commit is contained in:
commit
ec65a2ee8e
@ -70,6 +70,8 @@ v0.20.0 (UNRELEASED)
|
||||
- Add support for giving local libraries direct access to tags and duration.
|
||||
(Fixes: :issue:`967`)
|
||||
|
||||
- Add "--force" option for local scan (Fixes: :issue:'910') (PR: :issue:'1010')
|
||||
|
||||
**File scanner**
|
||||
|
||||
- Improve error logging for scan code (Fixes: :issue:`856`, PR: :issue:`874`)
|
||||
|
||||
@ -61,7 +61,10 @@ class ScanCommand(commands.Command):
|
||||
super(ScanCommand, self).__init__()
|
||||
self.add_argument('--limit',
|
||||
action='store', type=int, dest='limit', default=None,
|
||||
help='Maxmimum number of tracks to scan')
|
||||
help='Maximum number of tracks to scan')
|
||||
self.add_argument('--force',
|
||||
action='store_true', dest='force', default=False,
|
||||
help='Force rescan of all media files')
|
||||
|
||||
def run(self, args, config):
|
||||
media_dir = config['local']['media_dir']
|
||||
@ -97,7 +100,7 @@ class ScanCommand(commands.Command):
|
||||
if mtime is None:
|
||||
logger.debug('Missing file %s', track.uri)
|
||||
uris_to_remove.add(track.uri)
|
||||
elif mtime > track.last_modified:
|
||||
elif mtime > track.last_modified or args.force:
|
||||
uris_to_update.add(track.uri)
|
||||
uris_in_library.add(track.uri)
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user