document-viewer icon indicating copy to clipboard operation
document-viewer copied to clipboard

Number of pages in a document does not update if the file is replaced with a longer/shorter one

Open Iey4iej3 opened this issue 10 years ago • 2 comments

After updating a file which was previously opened, there are some issues. For example, previously it was foo.pdf with 10 pages, and I updated foo.pdf (in the same location) to attach 10 pages, then I open foo.pdf and Document Viewer gives me only first 10 pages to view. If I move foo.pdf to somewhere else and reopen it, then I can view the whole file.

It seems to me that the history data affects, and hashing isn't coded well.

Document Viewer v2.7.3 on Android

Iey4iej3 avatar Nov 03 '15 14:11 Iey4iej3

I think the problem is located here: https://github.com/SufficientlySecure/document-viewer/blob/master/document-viewer/src/main/java/org/ebookdroid/core/models/DocumentModel.java#L333

The DocumentInfo it's loading from a cache file contains the number of pages. The cache file name is only based on the document's filename.

ericwa avatar Nov 09 '15 19:11 ericwa

Another aspect of this problem is that all files opened from the "Downloads" app, which are opened through a content:// URI, share their book settings / current page.

ericwa avatar Feb 05 '16 00:02 ericwa