Importing tracks without album fails
Looks like it fails, maybe it could be handled on the top artist, or creating automatically an "Unkown Album" one ?
What I tried to import is a bunch of mixes which doesn't have an album at all.
root@api:/app# python manage.py import_files "/music/Aeroplane*/**.mp3" --recursive --noinput --no-acoustid
/usr/local/lib/python3.5/site-packages/psycopg2/__init__.py:144: UserWarning: The psycopg2 wheel package will be renamed from release 2.8; in order to keep installing from binary please use "pip install psycopg2-binary" instead. For details see: <http://initd.org/psycopg/docs/install.html#binary-install-from-pypi>.
""")
This will import 9 files matching this pattern: /music/Aeroplane*/**.mp3
Traceback (most recent call last):
File "/app/funkwhale_api/music/metadata.py", line 25, in get_id3_tag
return matches[0].text[0]
IndexError: list index out of range
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/app/funkwhale_api/music/metadata.py", line 134, in get
v = getter(self._file, real_key)
File "/app/funkwhale_api/music/metadata.py", line 27, in get_id3_tag
raise TagNotFound(k)
funkwhale_api.music.metadata.TagNotFound: 'TALB'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "manage.py", line 13, in <module>
execute_from_command_line(sys.argv)
File "/usr/local/lib/python3.5/site-packages/django/core/management/__init__.py", line 371, in execute_from_command_line
utility.execute()
File "/usr/local/lib/python3.5/site-packages/django/core/management/__init__.py", line 365, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/usr/local/lib/python3.5/site-packages/django/core/management/base.py", line 288, in run_from_argv
self.execute(*args, **cmd_options)
File "/usr/local/lib/python3.5/site-packages/django/core/management/base.py", line 335, in execute
output = self.handle(*args, **options)
File "/app/funkwhale_api/providers/audiofile/management/commands/import_files.py", line 90, in handle
batch = self.do_import(matching, user=user, options=options)
File "/usr/local/lib/python3.5/contextlib.py", line 30, in inner
return func(*args, **kwds)
File "/usr/local/lib/python3.5/site-packages/django/db/transaction.py", line 256, in __exit__
connection.set_autocommit(True)
File "/usr/local/lib/python3.5/site-packages/django/db/backends/base/base.py", line 409, in set_autocommit
self.run_and_clear_commit_hooks()
File "/usr/local/lib/python3.5/site-packages/django/db/backends/base/base.py", line 636, in run_and_clear_commit_hooks
func()
File "/app/funkwhale_api/common/utils.py", line 26, in <lambda>
lambda: f(*args, **kwargs)
File "/usr/local/lib/python3.5/site-packages/celery/local.py", line 191, in __call__
return self._get_current_object()(*a, **kw)
File "/usr/local/lib/python3.5/site-packages/celery/app/task.py", line 380, in __call__
return self.run(*args, **kwargs)
File "/app/funkwhale_api/taskapp/celery.py", line 41, in inner
return function(*args, **kwargs)
File "/app/funkwhale_api/music/tasks.py", line 93, in import_job_run
self.retry(exc=exc, countdown=30, max_retries=3)
File "/usr/local/lib/python3.5/site-packages/celery/app/task.py", line 653, in retry
raise_with_context(exc or Retry('Task can be retried', None))
File "/app/funkwhale_api/music/tasks.py", line 89, in import_job_run
return _do_import(import_job, replace, use_acoustid=use_acoustid)
File "/app/funkwhale_api/music/tasks.py", line 47, in _do_import
track = import_track_data_from_path(import_job.audio_file.path)
File "/app/funkwhale_api/providers/audiofile/tasks.py", line 23, in import_track_data_from_path
title__iexact=data.get('album'),
File "/app/funkwhale_api/music/metadata.py", line 137, in get
raise TagNotFound(real_key)
funkwhale_api.music.metadata.TagNotFound: 'TALB'
Sentry is attempting to send 1 pending error messages
Waiting up to 10 seconds
Press Ctrl-C to quit
root@api:/app#