Closed bdr99 closed 6 years ago
you could delete the old cover, and just use the gutenberg id with the original file name, if it exists
because maybe don't depend on the title staying the same to overwrite the cover file?
Ok, good point. I'll change it to use the ID as the file name. That way we won't even need the database migration.
Ok, the gutenberg id is now used as the file name. I have removed the database migration and model changes from this PR since they are no longer necessary. I also made a few more improvements to the logic in this part of the code.
The tests are currently failing because of another XML syntax error in the Standard Ebooks OPDS catalog. It is not related to the changes in this PR and is something Standard Ebooks needs to resolve on their end.
are you using a strict xml parser?
maybe mock or skip the test?
just add the decorator @unittest.skip("SE xml issue") to the test
I couldn't use the decorator because the tests are all in the same method. I couldn't break them into separate methods because they all rely on the same book object. So I just commented out the Standard Ebooks part of the test. It can be uncommented when the XML issue is resolved.
will push this to production so as not the delay you.
haven't looked at the code, but maybe the setup method of testcase could create the book object
deployed
Some repos such as this one, have very long repo names. The file name being generated for the cover image was 115 characters in length, but the FileField was using the default maximum length which was 100 characters. This PR increases the maximum to 500 characters. It includes a database migration which needs to be applied after the code is deployed. @eshellman Can you please do this when you get a chance?