Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IndexError: list index out of range in get_music_root #1

Closed
bricewge opened this issue Dec 5, 2016 · 7 comments
Closed

IndexError: list index out of range in get_music_root #1

bricewge opened this issue Dec 5, 2016 · 7 comments

Comments

@bricewge
Copy link

bricewge commented Dec 5, 2016

Went trying the latest version of your software I stubbed upon this:

DEBUG    2016-12-05 22:37:33,118 [507:EmbyBackend-3] mopidy_emby.backend
  Get Emby artist list
ERROR    2016-12-05 22:37:33,272 [507:Core-9] mopidy.core.library
  EmbyBackend backend caused an exception.
Traceback (most recent call last):
  File "/usr/lib/python2.7/site-packages/mopidy/core/library.py", line 19, in _backend_error_handling
    yield
  File "/usr/lib/python2.7/site-packages/mopidy/core/library.py", line 112, in _browse
    result = backend.library.browse(uri).get()
  File "/home/bricewge/.local/lib/python2.7/site-packages/pykka/threading.py", line 52, in get
    compat.reraise(*self._data['exc_info'])
  File "/home/bricewge/.local/lib/python2.7/site-packages/pykka/compat.py", line 12, in reraise
    exec('raise tp, value, tb')
  File "/home/bricewge/.local/lib/python2.7/site-packages/pykka/actor.py", line 201, in _actor_loop
    response = self._handle_receive(message)
  File "/home/bricewge/.local/lib/python2.7/site-packages/pykka/actor.py", line 295, in _handle_receive
    return callee(*message['args'], **message['kwargs'])
  File "/home/bricewge/.local/lib/python2.7/site-packages/mopidy_emby/backend.py", line 62, in browse
    return self.backend.remote.get_artists()
  File "/home/bricewge/.local/lib/python2.7/site-packages/mopidy_emby/backend.py", line 305, in get_artists
    music_root = self.get_music_root()
  File "/home/bricewge/.local/lib/python2.7/site-packages/mopidy_emby/backend.py", line 302, in get_music_root
    return id[0]
IndexError: list index out of range
DEBUG    2016-12-05 22:37:33,275 [507:HttpServer] mopidy.http.handlers
  Sent WebSocket message to 192.168.10.66: '{"jsonrpc": "2.0", "id": 18, "result": []}'

If there is way I can be helpful about this issue?

@xsteadfastx
Copy link
Owner

ok.... the thing is... it need to guess the music directory id. it looks like it cant find it. i will release a version in a few minutes that throws a exception and should have more debugging available that shows what directories are there to check. hang on

@xsteadfastx
Copy link
Owner

can you update and try again? please run mopidy -v for verbose output... if it comes to this error it should throw a exception and a debug output and i would ask you to paste it in here.

@bricewge
Copy link
Author

bricewge commented Dec 6, 2016

Following is the new backtrace with mopidy 0.1.3.

DEBUG    2016-12-06 14:12:55,523 [12568:EmbyBackend-3] mopidy_emby.backend
  Get Emby artist list
ERROR    2016-12-06 14:12:55,730 [12568:Core-9] mopidy.core.library
  EmbyBackend backend caused an exception.
Traceback (most recent call last):
  File "/usr/lib/python2.7/site-packages/mopidy/core/library.py", line 19, in _backend_error_handling
    yield
  File "/usr/lib/python2.7/site-packages/mopidy/core/library.py", line 112, in _browse
    result = backend.library.browse(uri).get()
  File "/home/bricewge/.local/lib/python2.7/site-packages/pykka/threading.py", line 52, in get
    compat.reraise(*self._data['exc_info'])
  File "/home/bricewge/.local/lib/python2.7/site-packages/pykka/compat.py", line 12, in reraise
    exec('raise tp, value, tb')
  File "/home/bricewge/.local/lib/python2.7/site-packages/pykka/actor.py", line 201, in _actor_loop
    response = self._handle_receive(message)
  File "/home/bricewge/.local/lib/python2.7/site-packages/pykka/actor.py", line 295, in _handle_receive
    return callee(*message['args'], **message['kwargs'])
  File "/home/bricewge/.local/lib/python2.7/site-packages/mopidy_emby/backend.py", line 62, in browse
    return self.backend.remote.get_artists()
  File "/home/bricewge/.local/lib/python2.7/site-packages/mopidy_emby/backend.py", line 317, in get_artists
    music_root = self.get_music_root()
  File "/home/bricewge/.local/lib/python2.7/site-packages/mopidy_emby/backend.py", line 314, in get_music_root
    raise Exception('Emby: Cant find music root directory')
Exception: Emby: Cant find music root directory
DEBUG    2016-12-06 14:12:55,733 [12568:HttpServer] mopidy.http.handlers
  Sent WebSocket message to 192.168.10.66: '{"jsonrpc": "2.0", "id": 18, "result": []}'

This error happen when I click on the emby source from the musicbox_webclient.

@xsteadfastx
Copy link
Owner

can you hold one for two days? i need to travel for my job and can look at it on friday. do you have a music typed directory in emby? it needs to have the name "Music".

@bricewge
Copy link
Author

bricewge commented Dec 6, 2016

Of course, this isn't pressing at all.
You pointed me in the right direction my music folder was named "Musiques" instead of "Music". Renaming it to "Music" solved the issue. Maybe instead of choosing the music root directory by it's name it should be done by content type to avoid this kind of issue.

@xsteadfastx
Copy link
Owner

xsteadfastx commented Dec 7, 2016 via email

@bricewge
Copy link
Author

Thanks for the fix, it work nicely now! (:

I don't think I am well seated to give you feedback since I'm only using mopidy for a few weeks. As so far as I have used this plugin, it do the job for me. It is nice to have have acces to your own centralized music library from the CLI.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants