Bug? "default.pdf" never occurrs

The "originalFilename" tag is not present in "SharePresentationEvent", and thus presentation_filename would never be "default.pdf". As a consequence, the thumbnails are always generated from the default.pdf.
This commit is contained in:
hiroshisuga 2020-06-14 17:35:26 +09:00 committed by GitHub
parent 81dec8363a
commit 024afe3d01
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -104,10 +104,14 @@ module BigBlueButton
BigBlueButton.logger.info("Task: Getting from events the presentation to be used for preview")
presentation = {}
doc = Nokogiri::XML(File.open(events_xml))
presentation_filenames = {}
doc.xpath("//event[@eventname='ConversionCompletedEvent']").each do |conversion_event|
presentation_filenames[conversion_event.xpath("presentationName").text] = conversion_event.xpath("originalFilename").text
end
doc.xpath("//event[@eventname='SharePresentationEvent']").each do |presentation_event|
# Extract presentation data from events
presentation_id = presentation_event.xpath("presentationName").text
presentation_filename = presentation_event.xpath("originalFilename").text
presentation_filename = presentation_filenames[presentation_id]
# Set textfile directory
textfiles_dir = "#{process_dir}/presentation/#{presentation_id}/textfiles"
# Set presentation hashmap to be returned