pjheslin / diogenes

Diogenes: an environment for reading Latin and Greek
https://d.iogen.es/d
Other
56 stars 10 forks source link

v4.0.0 bug: Diogenes makes browser re-download PDFs from localhost #25

Closed JayBrown closed 4 years ago

JayBrown commented 4 years ago

When looking up a word in the dictionary, Diogenes presents the options TLL & OLD in the upper right-hand corner. So far so good.

snap

But when I click on these links (any of the links), it doesn't open the PDF in my default PDF viewer directly (Skim, not Preview), but opens the localhost URL in Firefox, with modified filenames as well, which then asks me whether to open it in Skim, or download it.

snap

But it downloads the PDF in any case, from localhost, meaning that it's effectively copying a huge file every time I click on TLL or OLD in Diogenes.

snap

This probably needs to be fixed, because those are unnecessary copy operations that might reduce the SSD lifetime further. (I'm using a RAM disk for all downloads, so it's not an immediate problem on my Mac, but it might be a good thing for other users.)

Doc73 commented 4 years ago

In my PC, with Debian GNU/Linux 10, in both case it opens browser at localhost, but I obtain this result: 404 Not Found Location of the requested pdf file has not been set.

JayBrown commented 4 years ago

Did you point Diogenes to the TLL and OLD pdf files in the app's "Database Locations" panel?

snap

Doc73 commented 4 years ago

Ah, ok! Thanks! But in case of OLD, Diogenes opens a wrong page of the PDF. I did my tests with word lignum

JayBrown commented 4 years ago

You're right: in my case it opens the URL http://localhost:8888/ox-lat-dict.pdf#page=1051 in my browser, but Skim on macOS only opens page 1. EDIT: same with Apple Preview – just page 1.

And, more importantly: the PDF is always downloaded again and again and again…

Doc73 commented 4 years ago

My URl is http://localhost:8888/ox-lat-dict.pdf#page=1051, but it opens at pag. 1017

I linked a previous my file. Where do you download OLD's pdf????

JayBrown commented 4 years ago

I downloaded it from genesis.lib (Library Genesis). Might not be the PDF specifically suited for Diogenes. Where did you get yours?

As for the localhost download issue, the PDFs aren't even replaced. Copy after copy.

snap

JayBrown commented 4 years ago

But it seems to be a problem on macOS, because I just tried it with TLL for "lignum" with URL http://localhost:8888/tll-pdf/31.pdf#page=22, but the PDF reader doesn't jump to page 22 either.

Doc73 commented 4 years ago

Under Linux there is only the issue in page numbering: with other latin words, the pdf opens at different pages, even if not correct.

Furthermore, I can't find any ox-lat-dict.pdf file in my PC and my original file mantains its name, without changing it.

JayBrown commented 4 years ago

Diogenes is probably creating a copy of your original file somewhere, either directly or via download (as in my case.) (?)

Doc73 commented 4 years ago

I looked for it both in my home folder and in /tmp folder, but without success

pjheslin commented 4 years ago

If you have configured your default browser not to open up PDFs itself, but to download them or pass them off to another application, then then this functionality will not work.

P.

On Tue, 24 Sep 2019 at 16:14, Joss Brown notifications@github.com wrote:

When looking up a word in the dictionary, Diogenes presents the options TLL & OLD in the upper right-hand corner. So far so good.

[image: snap] https://camo.githubusercontent.com/d065fe29a35a86a34866e5fe71fec8d16724bc98/68747470733a2f2f692e696d6775722e636f6d2f594662787344492e6a7067

But when I click on these links (any of the links), it doesn't open the PDF in my default PDF viewer directly (Skim, not Preview), but opens the localhost URL in Firefox, with modified filenames as well, which then asks me whether to open it in Skim, or download it.

[image: snap] https://camo.githubusercontent.com/dc18040548b340d7e55db4a0f8e02fc2479ce910/68747470733a2f2f692e696d6775722e636f6d2f4a66666f766c352e6a7067

But it downloads the PDF in any case, from localhost, meaning that it's effectively copying a huge file every time I click on TLL or OLD in Diogenes.

[image: snap] https://camo.githubusercontent.com/f28cdba13eb987ef5766670ae522348b6d2745db/68747470733a2f2f692e696d6775722e636f6d2f703456714155302e6a7067

This probably needs to be fixed, because those are unnecessary copy operations that might reduce the SSD lifetime further. (I'm using a RAM disk for all downloads, so it's not an immediate problem on my Mac, but it might be a good thing for other users.)

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/pjheslin/diogenes/issues/25?email_source=notifications&email_token=ACG6TOWNIMNDD5SHCQNFWR3QLIVHBA5CNFSM4I2BCPB2YY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4HNLEM3A, or mute the thread https://github.com/notifications/unsubscribe-auth/ACG6TOQUFLQSA2LSYXMKQGDQLIVHBANCNFSM4I2BCPBQ .

pjheslin commented 4 years ago

If it opens to the wrong page, then you have a different PDF from mine.

P.

On Tue, 24 Sep 2019 at 17:41, Domenico Cufalo notifications@github.com wrote:

Ah, ok! Thanks! But in case of OLD, Diogenes opens a wrong page of the PDF. I did my tests with word lignum

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/pjheslin/diogenes/issues/25?email_source=notifications&email_token=ACG6TOT56BE6DF5NVDSYZRDQLI7M5A5CNFSM4I2BCPB2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD7PAHCI#issuecomment-534643593, or mute the thread https://github.com/notifications/unsubscribe-auth/ACG6TOTB2YANIGORMOJLUG3QLI7M5ANCNFSM4I2BCPBQ .

pjheslin commented 4 years ago

But you should not be downloading the PDFs. That is not the intended usage.

On Tue, 24 Sep 2019 at 17:56, Joss Brown notifications@github.com wrote:

I downloaded it from genesis.lib (Library Genesis). Might not be the PDF specifically suited for Diogenes. Where did you get yours?

As for the localhost download issue, the PDFs aren't even replaced. Copy after copy.

[image: snap] https://camo.githubusercontent.com/ee7221a5dda8e83b8a9024d5e82a0501a30c178c/68747470733a2f2f692e696d6775722e636f6d2f6358475a78536e2e6a7067

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/pjheslin/diogenes/issues/25?email_source=notifications&email_token=ACG6TOUO54JMNNZC2R7AOTLQLJBEBA5CNFSM4I2BCPB2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD7PBXNI#issuecomment-534649781, or mute the thread https://github.com/notifications/unsubscribe-auth/ACG6TOUSU6LMBLWWCOSI4JDQLJBEBANCNFSM4I2BCPBQ .

pjheslin commented 4 years ago

No. That file does not exist. It is part of the URI that serves as a proxy for the file you point to via the settings.

I’m not understanding what exactly the problem is here.

On Tue, 24 Sep 2019 at 18:06, Domenico Cufalo notifications@github.com wrote:

I looked for it both in my home folder and in /tmp folder, but without success

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/pjheslin/diogenes/issues/25?email_source=notifications&email_token=ACG6TORFDI74KUHX24KC5KTQLJCJXA5CNFSM4I2BCPB2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD7PC2NQ#issuecomment-534654262, or mute the thread https://github.com/notifications/unsubscribe-auth/ACG6TOTCXRUBD37ZQ4RCERTQLJCJXANCNFSM4I2BCPBQ .

Doc73 commented 4 years ago

@pjheslin Yes, maybe my PDF is different from yours, but my opinion is: is really worth having this so unstable feature, which depends on some specific pdf?

Another question: why in browser is the pdf named ox-lat-dict.pdf, although my file has another name?

Doc73 commented 4 years ago

@pjheslin I'm sorry, but I read your response at my second question too late. :-D

pjheslin commented 4 years ago

We’ll see if people like the feature. I have no way of knowing how many different PDF versions of the OLD are in circulation.

The browser will pull the name ox-lat-dict .pdf out of the URI and will use it as the file name if you ask the browser to download or save the file. But why would you do that?

P.

On Tue, 24 Sep 2019 at 21:12, Domenico Cufalo notifications@github.com wrote:

@pjheslin https://github.com/pjheslin Yes, maybe my PDF is different from yours, but my opinion is: is really worth having this so unstable feature, which depends on some specific pdf?

Another question: why in browser is the pdf named ox-lat-dict.pdf, although my file has another name?

— You are receiving this because you were mentioned.

Reply to this email directly, view it on GitHub https://github.com/pjheslin/diogenes/issues/25?email_source=notifications&email_token=ACG6TOV5AV2VPC3Y22JOP6DQLJYDJA5CNFSM4I2BCPB2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD7PU3SQ#issuecomment-534728138, or mute the thread https://github.com/notifications/unsubscribe-auth/ACG6TOU3FSOZUBPTHET7D7DQLJYDJANCNFSM4I2BCPBQ .

Doc73 commented 4 years ago

@pjheslin Yes, I understood! But, please, remember that perhaps it is not always legal to own and/or download that pdf from some site.... :smiley:

pjheslin commented 4 years ago

I have implemented the OLD functionality for users who own a physical copy of the printed dictionary, as I do, and who have a PDF of it for their personal use.

I'll close this issue now, but I'll make a few points:

Peter

mlana commented 4 years ago

hi peter, i have a similar problem: when trying to open the TLL from the link up to the right (to go to the word adhuc) the browser shows an URL of the type: http://localhost:8888/tll-pdf/1.pdf#page=341 (which is right, adhuc is there) but i get a strange error 404: Requested pdf file (/Users/mlana/Downloads/ThLL/000924304{ThLL vol. 01 col. 0001–0724 (a–adli)}[CC BY-NC-ND].pdf) was not fou the path is correct but there are those strange characters which probably are the cause of the error. in the Mac, the names of the files in the path are ok. any idea? best maurizio

pjheslin commented 4 years ago

This is a separate issue. I have seen this problem on Windows, but not Macs. Did you download the PDFs via Diogenes on your Mac or did you download them separately?

P.

JayBrown commented 4 years ago

I have now set Firefox to always preview PDFs, and it works great. Love this new feature. For other PDFs I'll need to select to download from the contextual menu, but that's fine.

pjheslin commented 4 years ago

Excellent! I've added an FAQ about needing to ensure that your default browser is set up to open PDFs. Thanks for the report.