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

dir2opds on Microsoft Windows generates incorrect path (slashes/directory separator) #7

Closed
clach04 opened this issue May 25, 2020 · 4 comments

Comments

@clach04
Copy link

clach04 commented May 25, 2020

When running dir2opds under Microsoft Windows the wrong directory separator is used, \ versus /. Example:

<feed>
<title>Catalog in /cbz</title>
<id>/cbz</id>
<link rel="start" href="/" type="application/atom+xml;profile=opds-catalog;kind=navigation"/>
<updated>2020-05-25T09:20:39-07:00</updated>
<author>
<name/>
</author>
<entry>
<title>Elf Receiver Radio-Craft August 1936.cbz</title>
<id>/cbzElf Receiver Radio-Craft August 1936.cbz</id>
<link rel="http://opds-spec.org/acquisition" href="\cbz\Elf%20Receiver%20Radio-Craft%20August%201936.cbz" type="application/x-cbz" title="Elf Receiver Radio-Craft August 1936.cbz"/>
<published>2020-05-25T09:20:39-07:00</published>
<updated>2020-05-25T09:20:39-07:00</updated>
</entry>
</feed> 

quick hack to address this is in issue #4 via (probably dumb) string search/replace (I don't know Go well enough to know the best way to handle this).

@clach04 clach04 changed the title dir2opds on windows generates incorrect path (slashes/direcfoty seporator) dir2opds on windows generates incorrect path (slashes/directory separator) May 25, 2020
@clach04 clach04 changed the title dir2opds on windows generates incorrect path (slashes/directory separator) dir2opds on Microsoft Windows generates incorrect path (slashes/directory separator) May 25, 2020
@clach04
Copy link
Author

clach04 commented May 25, 2020

hack that works for me clach04@2768fd1

@dubyte
Copy link
Owner

dubyte commented May 25, 2020

Ahh I see, thanks, I will check that.

@dubyte
Copy link
Owner

dubyte commented May 25, 2020

I think instead of filepath.join this should be using: https://golang.org/pkg/path/#Join

That should fix the problem in windows and Linux, I will test later.

@dubyte
Copy link
Owner

dubyte commented Jun 18, 2020

Hello, @clach04 I think I fix this in the last release, could you confirm?
Thanks

@dubyte dubyte closed this as completed Dec 23, 2020
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