pedia / epub3

epub3 read and write
1 stars 0 forks source link

package does not work on windows #1

Open denniskaselow opened 1 month ago

denniskaselow commented 1 month ago

I'm not sure if windows is supposed to be supported (it's not tested in the github actions, but windows is mentioned as supported platform in pubspec.yaml), but at the moment it does not work on windows when trying to read an epub file.

The reason is, the files in the Archive use / as a path separator, but you are using the path package to create platform dependent paths: https://github.com/pedia/epub3/blob/8ed5c7b098b88c5fd359815c6ad96c33c458fa45/epub3/lib/src/reader.dart#L40

So when it looks for the nav.html it can't be found because int the following code path = 'EPUB\nav.html' while the archive package only knows about file.name = 'EPUB/nav.html':

https://github.com/pedia/epub3/blob/8ed5c7b098b88c5fd359815c6ad96c33c458fa45/epub3/lib/src/reader.dart#L288-L295

There may be more places where this causes errors on windows.

pedia commented 3 weeks ago

I don't have windows. PR welcome