FinalsClub / karmaworld

KarmaNotes.org v3.0
GNU Affero General Public License v3.0
7 stars 6 forks source link

is PDFView used anymore? #317

Closed btbonval closed 10 years ago

btbonval commented 10 years ago

There are a number of instances of it in the code, but it seems we no longer deal with raw PDFs or PPTs. Rather, we get something converted out of Filepicker+Google Drive or Filepicker+PDF2HTML and work with that (hosting the resultant HTML statically).

Here are relevant areas of code that might be ripe for cleanup:

btbonval commented 10 years ago

Bumped into this while looking for fp_file, so it is quite possible this stuff is still relevant.

Pretty sure PDFs are not handled in this way anymore. However, I'm not sure what happens to PPTs. Those seem to be handled by PDFView also.

charlesconnell commented 10 years ago

PDFs that were uploaded before the installation of pdf2html still use pdfjs to display them. We should obviously migrate these to HTML at some point.

btbonval commented 10 years ago

Good point. I keep forgetting that Production has files from the before time. The long long ago.

btbonval commented 10 years ago

It would make sense to find those PDFs and reprocess them, rather than keeping old functionality we don't need (which is a source for future bugs and adds confusion to people trying to learn the system).

charlesconnell commented 10 years ago

Yeah. I'll do that.

btbonval commented 10 years ago

So the production database is strangely devoid of old notes. I'm not sure when this happened, because I thought there were a bunch of old notes. All notes have timestamps and the oldest timestamp is November 9th. I'm not sure if old timestamps were overwritten or what.

I can't find any instances where ppt or pdf might be set to true for this line of code: https://github.com/FinalsClub/karmaworld/blob/8ecc45d674be9b5957fb2774c637cb8d86342343/karmaworld/templates/notes/note_detail.html#L165

The database has no instances of pdf_file or file_type that are relevant.

karmanotes=# SELECT count(*) FROM notes_note WHERE uploaded_at IS NULL;         
 count 
-------
     0
(1 row)

karmanotes=# SELECT min(uploaded_at) FROM notes_note;
          min           
------------------------
 2013-11-09 18:11:36+00
(1 row)

karmanotes=# SELECT distinct(file_type) FROM notes_note;
 file_type 
-----------
 ???
(1 row)

karmanotes=# SELECT distinct(pdf_file) FROM notes_note;
 pdf_file 
----------

(1 row)
btbonval commented 10 years ago

On production there are a bunch of PDFs on the hard disk under /var/www/uploads. Some have been reuploaded. It looks like most have not. There's no way to tell what courses they were supposed to be from, but I don't know how that data got lost.

It might be in one of the other databases? karmanotes_beta seems to reference the files, using an old schema I don't recognize.

                            file                            
------------------------------------------------------------
 /var/www/uploads/Pauls_Justice_Study_Guide_1.pdf
 /var/www/uploads/Pauls_Justice_Terms_1.pdf
 /var/www/uploads/Justice_Biography_Cheat_Sheet.pdf
 /var/www/uploads/Final_Exam_Study_Guide_-_Hist_1641.pdf
 /var/www/uploads/heroes_guide_2006-01-10.pdf
 /var/www/uploads/Complete_study_guide_for_OEB_114.pdf
 /var/www/uploads/practice_questions.pdf
 /var/www/uploads/HAA10_Final_Study_Guide.pdf
 /var/www/uploads/History_B-49_Midterm_Review_Version_2.pdf
 /var/www/uploads/Parzen_Stat104_Syllabus_Spring2012.pdf
(10 rows)
charlesconnell commented 10 years ago

Okay. I'll tear out PDFView then.

charlesconnell commented 10 years ago

Done