dubyte / dir2opds

Serve an OPDS based on a directory
GNU General Public License v3.0
59 stars 12 forks source link

Moon+ Reader v5.2.8 (latest as of 2020-05) fails to download meta data and files #4

Closed clach04 closed 4 years ago

clach04 commented 4 years ago

See https://github.com/clach04/dir2opds/wiki/Tested-Clients

I followed the readme and had 2 directories and then in each directories only files:

but Moon+Reader fails to download anything after the directory metadata. This is is due to Moon+Reader expecting full path, e.g.:

diff --git a/main.go b/main.go
index 1e0a0e3..c661de3 100644
--- a/main.go
+++ b/main.go
@@ -160,7 +160,7 @@ func getType(name string, pathType int) string {
 }

 func getHref(req *http.Request, name string) string {
-       return strings.Replace(
+       return "http://192.168.1.2:8080" + strings.Replace(  // Fully qualify test
 hack for Moon+ Reader
         filepath.Join(req.URL.EscapedPath(), url.PathEscape(name)),
         "\\", "/", -1)  // Windows path conversion - NOOP on non-Windows
 }

NOTE patch against https://github.com/clach04/dir2opds/tree/comic branch

dubyte commented 4 years ago

could you confirm if this still happening after the changes in: https://github.com/dubyte/dir2opds/tree/release_0_4_0

dubyte commented 4 years ago

the server doesn't need the full path because if the host is not provided it is implicit that it is in the same server.

the download issue was because I was urlscaping it when it is not really needed.

It should be fixed in v0.0.4

btw do you know that you can do cross-compiling? https://www.digitalocean.com/community/tutorials/how-to-build-go-executables-for-multiple-platforms-on-ubuntu-16-04

the trick is to update GOOS and GOARCH env variables.

clach04 commented 4 years ago

thanks @dubyte I just learned about cross compiling, and I was able to install a current golang version :-) I need to do some more testing now when I get a few hours free :)

clach04 commented 4 years ago

Managed to get time to build you headrevs on master with Raspberry Pi:

Worked great! Not had chance to try with Moon+ but based on inspection of xml in web browser - looks good :+1: :)

clach04 commented 4 years ago

Also able to get this running on a Rock64 using a binary built under Raspbian. :)

I was not able to build in-place (distro I run live only had gccgo-go, which reports as go version go1.6.1 gccgo (Debian 6.3.0-18+deb9u1) 6.3.0 20170516 linux/arm

dubyte commented 4 years ago

Nice

clach04 commented 4 years ago

Confirmed Moon+ Reader is working with version in master and includes full path (sans protocol). :)

dubyte commented 4 years ago

Nice thanks