Skip to content
This repository has been archived by the owner on Sep 20, 2021. It is now read-only.

Bibupload improvements #183

Open
wants to merge 3 commits into
base: prod
Choose a base branch
from

Conversation

jalavik
Copy link

@jalavik jalavik commented Feb 11, 2015

Revived branch that we should have a look at again.

Basically, it deals with proper downloading from FFT tags and content type detection. Avoiding, say, uploading HTML as PDF etc.

@kaplun @tsgit

* Updates the way external file format detection is happening, by
  trying to compare file extensions detected from downloaded file
  with expected MIME-type or extension.

* Improves the error message when formats are different.

Signed-off-by: Jan Aage Lavik <[email protected]>
* Changes to use the filedownloadutils.download_url() function instead
  of bibdocfile.download_url() in order to benefit from (1) timeout
  and retry mechanics, and (2) improved format detection.

* BibUpload will now abort the FFT update should the format received
  from the given URL be different than the docformat expected.

Signed-off-by: Jan Aage Lavik <[email protected]>
* Improves the bibdocfile.file_strip_ext() function to work with
  cases where the same extension is doubled, for example if the
  URL would be "foo.pdf.pdf" now only the first ".pdf" is stripped.

* Adds a new file with BibDocFile unit tests and implements tests
  for file_strip_ext.

Signed-off-by: Jan Aage Lavik <[email protected]>
@kaplun kaplun added the prod label Feb 11, 2015
@kaplun
Copy link

kaplun commented Feb 11, 2015

You already rebased it against latest prod?

@jalavik
Copy link
Author

jalavik commented Feb 11, 2015

@kaplun Yep, it is.

@jalavik
Copy link
Author

jalavik commented Oct 22, 2015

Shall we dare put it up? @kaplun @tsgit

@jalavik jalavik changed the title WIP - prod bibupload improvements Bibupload improvements Oct 22, 2015
@kaplun
Copy link

kaplun commented Oct 23, 2015

:shipit: for me. Maybe @tsgit wants to have one last look.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants