audiobookshelf icon indicating copy to clipboard operation
audiobookshelf copied to clipboard

UNC Path adds drive letter. [Bug]:

Open MrKuenning opened this issue 3 years ago • 6 comments
trafficstars

Describe the issue

A library located at \\NAS\Media\Audio\Library is being rewritten as "E:\\NAS\\Media\\Audio\\Library"

path: "E:\\Media\\Media\\Audio\\Library - Audiobooks\\Hank The Cowdog\\Hank The Cowdog - 3 - It's a Dog's Life.m4b"

Resulting in scan errors:

Failed to getFileTimestampsWithIno [Error: ENOENT: no such file or directory, stat 'E:\NAS\Media\Audio\Library - Audiobooks\Hank The Cowdog\Hank The Cowdog - 3 - It's a Dog's Life.m4b']
  errno: -4058,
  code: 'ENOENT',
  syscall: 'stat',
  path: "E:\\NAS\\Media\\Audio\\Library - Audiobooks\\Hank The Cowdog\\Hank The Cowdog - 3 - It's a Dog's Life.m4b"
}

Steps to reproduce the issue

  1. Add a new library from a UNC path.
  2. Scan library

Audiobookshelf version

Windows Build : v2.0.17

How are you running audiobookshelf?

Other

MrKuenning avatar May 29 '22 09:05 MrKuenning

Abs is resolving relative paths and I think I'd like to keep it that way for now. Wouldn't a UNC path be entered with double backslashes like \\NAS\Media\etc?

I think it could check for a double slash before it resolves it. I'm not sure I don't use any UNC paths so let me know.

advplyr avatar May 29 '22 12:05 advplyr

Strange I typed it with two backslashes, but the github post formatting was removing the first one. I added code markers so it will show up now.

It's basically taking a network SMB share and appending the drive letter that the exe file is located into the path.

MrKuenning avatar Jun 04 '22 07:06 MrKuenning

Does that mean it is working now for you?

advplyr avatar Jun 04 '22 11:06 advplyr

No, I was just saying that I do have double back shashes. Git just made it look like I don't.

I downloaded the latest release v2.0.20 and it still fails to scan the library. The strange thing is it lists all the files one by one and then says it can find that file because it cant be found.

MrKuenning avatar Jun 05 '22 23:06 MrKuenning

What do you mean it lists all the files one by one?

It is adding the drive letter and still able to find that path?

advplyr avatar Jun 05 '22 23:06 advplyr

For example: I have a SMB share on my NAS with the path \\Media\Media\Audio\Library - Audiobooks In that share, I have a folder called Hank The Cowdog with multiple books in it.

\\Media\Media\Audio\Library - Audiobooks\Hank The Cowdog\Hank The Cowdog - 1 - The Original Adventures.m4b
\\Media\Media\Audio\Library - Audiobooks\Hank The Cowdog\Hank The Cowdog - 3 - It's a Dog's Life.m4b
\\Media\Media\Audio\Library - Audiobooks\Hank The Cowdog\Hank The Cowdog - 7 - The Curse Of The Corncob.m4b

When I make a new library and point it at the Audiobook folder I get the following errors listed in the console:

Failed to getFileTimestampsWithIno [Error: ENOENT: no such file or directory, stat 'E:\Media\Media\Audio\Library - Audiobooks\Hank The Cowdog\Hank The Cowdog - 1 - The Original Adventures.m4b'] {
  errno: -4058,
  code: 'ENOENT',
  syscall: 'stat',
  path: 'E:\\Media\\Media\\Audio\\Library - Audiobooks\\Hank The Cowdog\\Hank The Cowdog - 1 - The Original Adventures.m4b'
}
Failed to getFileTimestampsWithIno [Error: ENOENT: no such file or directory, stat 'E:\Media\Media\Audio\Library - Audiobooks\Hank The Cowdog\Hank The Cowdog - 7 - The Curse Of The Incredible Priceless Corncob.m4b'] {
  errno: -4058,
  code: 'ENOENT',
  syscall: 'stat',
  path: 'E:\\Media\\Media\\Audio\\Library - Audiobooks\\Hank The Cowdog\\Hank The Cowdog - 7 - The Curse Of The  Corncob.m4b'
}
Failed to getFileTimestampsWithIno [Error: ENOENT: no such file or directory, stat 'E:\Media\Media\Audio\Library - Audiobooks\Hank The Cowdog\Hank The Cowdog - 3 - It's a Dog's Life.m4b'] {
  errno: -4058,
  code: 'ENOENT',
  syscall: 'stat',
  path: "E:\\Media\\Media\\Audio\\Library - Audiobooks\\Hank The Cowdog\\Hank The Cowdog - 3 - It's a Dog's Life.m4b"
}

So it appends an "E" and then lists the files that are there and says they can't be found. Nothing shows up in the library.

MrKuenning avatar Jun 07 '22 18:06 MrKuenning