mikiher / audiobookshelf-windows

Installs and manages Audiobookshelf on Windows
59 stars 1 forks source link

Adding a library #1

Closed lemendoza956 closed 8 months ago

lemendoza956 commented 9 months ago

Screenshot 2024-01-01 120332 Hello thanks for making the windows version! I just installed it and it installs fine. How can I add a library. The browse for folder doesn't seem to work. I just get Note: folders already mapped will not be shown.

mikiher commented 9 months ago

I am able to reproduce this. Will investigate - it seems like this is a server issue, probably a side-effect of packaging it into an exe.

As a workaround, just type in (or copy-paste) the folder you'd like to add. This worked fine for me.

mikiher commented 9 months ago

OK, just to note that according to the documentation (and also from looking at the code), "Browse for Folder" is not currently working for non-Docker installs. quoting from that page:

NOTE: For installs that are not using Docker the folder path will need to be entered manually, the "Browse for Folder" button is a work-in-progress for non-Docker installs.

I am not sure what exactly is behind the current design, but (even if I fix the exe-packaging-related issue), The "Browse for Folder" dialog won't let you choose any arbitrary folder on you Windows machine, which is what I think it needs to do.

@advplyr, maybe you'd like to comment here?

advplyr commented 9 months ago

We can build something specific for Windows. I wrote a quick test to get the drives using Node

const exec = require('child_process').exec

exec('wmic logicaldisk get name', (error, stdout, stderr) => {
  if (error) {
    console.error(`Error: ${error}`)
    return
  }
  let driveLetters = stdout.split(/\r?\n/).map(line => line.trim()).filter(line => line).slice(1)
  console.log('Drives', driveLetters)
})

Output

Drives [ 'C:', 'Z:' ]

The folder browser would return the drives and the first level of the first drive then as you click in to each path it would make another API request to get the next levels. I don't think this will be too difficult to build.

advplyr commented 9 months ago

I just built this https://github.com/advplyr/audiobookshelf/commit/9f909b0d85c6c6961bb7da80a7f2bdce265f07d6

mikiher commented 9 months ago

Works very nicely (in both standard and pkg modes)! I'll include it in the next release.

mikiher commented 8 months ago

This was fixed in v2.7.2. Closing.