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

Script crashes when a book has no shelf assigned #8

Open
Geronimoes opened this issue Mar 24, 2024 · 0 comments
Open

Script crashes when a book has no shelf assigned #8

Geronimoes opened this issue Mar 24, 2024 · 0 comments

Comments

@Geronimoes
Copy link

First off, thanks a lot for working on this - it fills a need I had for my setup, and works well in most cases!

The issue I encountered: when a book is not assigned to a shelf (other books are assigned to shelves on my setup, this was a test), the script will run into an error when downloading to the local client. Here is the error text:

__main__.py:27Traceback (most recent call last):
  File "/home/username/.local/bin/obsidian_to_bookstack", line 8, in <module>
    sys.exit(main())
  File "/home/username/.local/pipx/venvs/obsidian-to-bookstack/lib/python3.10/site-packages/obsidian_to_bookstack/__main__.py", line 119, in main
    cli()
  File "/home/username/.local/pipx/venvs/obsidian-to-bookstack/lib/python3.10/site-packages/click/core.py", line 1157, in __call__
    return self.main(*args, **kwargs)
  File "/home/username/.local/pipx/venvs/obsidian-to-bookstack/lib/python3.10/site-packages/click/core.py", line 1078, in main
    rv = self.invoke(ctx)
  File "/home/username/.local/pipx/venvs/obsidian-to-bookstack/lib/python3.10/site-packages/click/core.py", line 1688, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/home/username/.local/pipx/venvs/obsidian-to-bookstack/lib/python3.10/site-packages/click/core.py", line 1434, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/home/username/.local/pipx/venvs/obsidian-to-bookstack/lib/python3.10/site-packages/click/core.py", line 783, in invoke
    return __callback(*args, **kwargs)
  File "/home/username/.local/pipx/venvs/obsidian-to-bookstack/lib/python3.10/site-packages/click/decorators.py", line 33, in new_func
    return f(get_current_context(), *args, **kwargs)
  File "/home/username/.local/pipx/venvs/obsidian-to-bookstack/lib/python3.10/site-packages/obsidian_to_bookstack/__main__.py", line 59, in local
    b.sync_local()
  File "/home/username/.local/pipx/venvs/obsidian-to-bookstack/lib/python3.10/site-packages/obsidian_to_bookstack/bookstack/bookstack.py", line 291, in sync_local
    self.book_collector.create_local_missing_books()
  File "/home/username/.local/pipx/venvs/obsidian-to-bookstack/lib/python3.10/site-packages/obsidian_to_bookstack/bookstack/collectors/local/BookCollector.py", line 71, in create_local_missing_books
    path = os.path.join(self.path, book.shelf.name, book.name)
AttributeError: 'NoneType' object has no attribute 'name'
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

1 participant