LeoKlaus / plappa

An Audiobook client for Jellyfin and AudioBookShelf, written in Swift/SwiftUI.
https://plappa.me
159 stars 0 forks source link

[BUG] audiobookshelf: cannot log in with no library #75

Closed kgraefe closed 2 months ago

kgraefe commented 2 months ago

Describe the bug I set up a fresh audiobookshelf instance and did not create a library yet. When trying to connect, Plappa fails with no message.

As soon as I create a library, the login works (the debug log contained a hint).

To Reproduce Steps to reproduce the behavior:

  1. Create new audiobookshelf instance (don't create any library)
  2. Start fresh install of Plappa
  3. Try to connect

Expected behavior Either login and handle the empty library list gracefully or at least show an appropriate error message

Logs

[25.4.2024, 11:59] [CoreDataHandler] Initializing core data store...
[25.4.2024, 11:59] [CoreDataHandler] CoreData store initialized
[25.4.2024, 11:59] [AudioBookShelfAPIHandler] Tried to init ABS APIHandler without server url or username
[25.4.2024, 11:59] [AudioBookShelfAPIHandler] Tried to init ABS APIHandler without server url or username
[25.4.2024, 11:59] [JellyfinAPIHandler] Couldn't connect to server: Could not connect to the server.
[25.4.2024, 11:59] [JellyfinAPIHandler] Couldn't connect to server: Could not connect to the server.
[25.4.2024, 11:59] [AudioBookShelfAPIHandler] Couldn't connect to server: Could not connect to the server.
[25.4.2024, 11:59] [plappa] Encountered an error while decoding auth response: The data couldn’t be read because it is missing.
valueNotFound(Swift.String, Swift.DecodingError.Context(codingPath: [CodingKeys(stringValue: "userDefaultLibraryId", intValue: nil)], debugDescription: "Cannot get unkeyed decoding container -- found null value instead", underlyingError: nil))

Environment(please complete the following information):

Additional context Add any other context about the problem here.

LeoKlaus commented 2 months ago

Hey Konrad, thanks for reporting this!

I think userDefaultLibraryId is set once you log in to web interface with a user. After that you should be able to log in with plappa.

I'll make sure to fix this with the next update!

LeoKlaus commented 2 months ago

I've already committed the fix, it'll release with the next update.

kgraefe commented 2 months ago

I think userDefaultLibraryId is set once you log in to web interface with a user.

No, I did that and it did not resolve the issue. Creating a library did.

LeoKlaus commented 2 months ago

Thanks for the update.