Merge branch '111-skip-acoustid' into 'develop'

Resolve "Allow skip accoustid entirely on music import (CLI)"

Closes #111

See merge request funkwhale/funkwhale!79
This commit is contained in:
Eliot Berriot 2018-03-06 20:54:28 +00:00
commit 20ba6f926a
7 changed files with 97 additions and 13 deletions

View file

@ -34,6 +34,13 @@ class Command(BaseCommand):
default=False,
help='Will launch celery tasks for each file to import instead of doing it synchronously and block the CLI',
)
parser.add_argument(
'--no-acoustid',
action='store_true',
dest='no_acoustid',
default=False,
help='Use this flag to completely bypass acoustid completely',
)
parser.add_argument(
'--noinput', '--no-input', action='store_false', dest='interactive',
help="Do NOT prompt the user for input of any kind.",
@ -108,7 +115,10 @@ class Command(BaseCommand):
job.save()
try:
utils.on_commit(import_handler, import_job_id=job.pk)
utils.on_commit(
import_handler,
import_job_id=job.pk,
use_acoustid=not options['no_acoustid'])
except Exception as e:
self.stdout.write('Error: {}'.format(e))