johnfactotum / foliate

Read e-books in style
https://johnfactotum.github.io/foliate/
GNU General Public License v3.0
6.25k stars 288 forks source link

Foliate can't open epubs from the Library #1209

Closed marcioccamargo closed 8 months ago

marcioccamargo commented 9 months ago

Describe the bug I can't open EPUBs that are added to my catalog.

To Reproduce Steps to reproduce the behavior:

  1. Open Nautilus.
  2. Find an .epub file and open it with Foliate.
  3. You can read normally, but when you return to the library, all books are inaccessible. When I try to open one epub, a message appears: "The book cannot be opened."

Expected behavior A clear and concise description of what you expected to happen.

Screenshots If applicable, add screenshots to help explain your problem.

Version:

Additional context I tried this with all my epubs, they are stored locally. Foliate opens the file normally when I double click the file in nautilus, but when I try to continue to read a epub in the library, it doesn't work.

Here is a video:

Gravação de tela de 2024-01-05 18-58-46.webm

marcioccamargo commented 9 months ago

A better video:

Gravação de tela de 2024-01-05 19-03-21.webm

RuggeroRebellato commented 9 months ago

Same here.

ConEstArthur commented 9 months ago

Facing the same issue. I mentioned the same in #1178 but I was only facing it in files that I open from file explorer and not "Open File" option from Foliate. However recently I have noticed I face the same issue with files that had been opened from Foliate itself.

I am on the same platform as you are on.

crimsonfall commented 9 months ago

That's odd.

I have faced this same issue in previous versions of Foliate, while also on Fedora (KDE) no less. I thought that the app's rewrite would have fixed it.

marcioccamargo commented 9 months ago

That's odd.

I have faced this same issue in previous versions of Foliate, while also on Fedora (KDE) no less. I thought that the app's rewrite would have fixed it.

Same for me.

johnfactotum commented 9 months ago

This particular bug is a regression in v3.1.0. For some reason I can't seem to reproduce it when running it with GNOME Builder, which is why the bug made it to the release.

Anyway, to fix this properly, it needs to get the permissions somehow, either by granting filesystem permissions, or by somehow using the documents portal directly. Though it would be nice if Tracker has an API for this.

For now a workaround would be either adding filesystem permissions for the locations indexed by Tracker, or removing permission for Tracker all together.

Probably the easiest fix would be to add --filesystem=xdg-documents:ro and --filesystem=xdg-download:ro. That would fix #942/#1178 (provided that your files are in those locations and indexed by Tracker).

But it might be better to have a bug fix release that simply removes the Tracker policy. Because Tracker never worked for the Flatpak version of Foliate, anyway.

ConEstArthur commented 7 months ago

Facing the same issue. I mentioned the same in #1178 but I was only facing it in files that I open from file explorer and not "Open File" option from Foliate. However recently I have noticed I face the same issue with files that had been opened from Foliate itself.

I am on the same platform as you are on.

facing the same thing again ; foliate does not remember location of the books I have in my library after a restart of the system. I get "Book cannot be opened" for every book in my collection. #1178

Edit:- It works now I do not know how..

marcioccamargo commented 6 months ago

I just upgraded to Foliate 3.1.1(from flathub), but the problem persists. I am sending a video showing the issue. For some reason, one of the epubs is opening without a problem. I don't know what is going on. There is nothing different about this particular epub; they are all in the same directory with the exception of "Eloquent Javascript."

After I deleted all epubs from the library, they started to open normally again. However, after I closed Foliate, the problem started again.

Gravação de tela de 2024-04-04 12-19-20.webm

johnfactotum commented 6 months ago

Yes, that's #942 (which is the same as #1178), which is different from this issue (#1209).

To clarify, #942 is the issue where the file is no longer exported by the portal after a while. You can work around #942 using Tracker, which will report the path of the file to Foliate. However it can only get the original path of the file, which Foliate cannot access from the sandbox, causing this issue, #1209, where you can't open files from the library even if they are still available from the portal.

In other words, #1209 was caused by an incomplete solution to #942. #1209 was fixed by unfixing #942.

To actually fix #942, one could add the following permissions:

marcioccamargo commented 6 months ago

I got it, thanks!

FabianEscarate commented 2 months ago

hi. i don´t know if it's the same problem but i did this step (previuly i install folliate from flathub). 1.- install Flatseal (form flathub) 2.- add this Variable in "Variable seccion" WEBKIT_DISABLE_DMABUF_RENDERER=1 3.- try again to open foliate