From 4fcfa03d0cc4e5d4f2c02d0cafa0c7a1c1ebf7e7 Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Wed, 5 Feb 2014 01:06:46 -0500 Subject: v5 v6: epub, hash digests used only if available --- lib/sisu/v5/xhtml_epub2_format.rb | 10 ++++++---- lib/sisu/v6/xhtml_epub2_format.rb | 10 ++++++---- 2 files changed, 12 insertions(+), 8 deletions(-) (limited to 'lib') diff --git a/lib/sisu/v5/xhtml_epub2_format.rb b/lib/sisu/v5/xhtml_epub2_format.rb index e3b877aa..6522378b 100644 --- a/lib/sisu/v5/xhtml_epub2_format.rb +++ b/lib/sisu/v5/xhtml_epub2_format.rb @@ -1362,12 +1362,13 @@ output_epub_cont_seg.close depth=@md.lvs[1] + @md.lvs[2] + @md.lvs[3] + @md.lvs[4] title=SanitizeXML.xml(@md.title.full) author=SanitizeXML.xml(@md.author) + dgst=(@md.dgst.is_a?(Array) and @md.dgst.length > 1) ? @md.dgst[1] : 'na' <<-WOK #{title} by #{author} - + @@ -1579,18 +1580,19 @@ output_epub_cont_seg.close else '' end f=SiSU_Env::FileOp.new(@md) + dgst=(@md.dgst.is_a?(Array) and @md.dgst.length > 1) ? @md.dgst[1] : 'na' <<-WOK <#{$ep[:o]}metadata xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:opf="http://www.idpf.org/2007/opf" xmlns:dcterms="http://purl.org/dc/terms/" xmlns:dc="http://purl.org/dc/elements/1.1/" - unique-identifier="urn:uuid:#{@md.dgst[1]}" version="2.0"> + unique-identifier="urn:uuid:#{dgst}" version="2.0"> #{@md.title.full} #{cover_image}#{author}#{editor}#{translator}#{illustrator}#{language}#{date_published}#{subject}#{rights} #{f.output_path.epub.url.gsub(/http:\/\//,'')}/#{f.base_filename.epub} - urn:uuid:#{@md.dgst[1]} - + urn:uuid:#{dgst} + WOK end diff --git a/lib/sisu/v6/xhtml_epub2_format.rb b/lib/sisu/v6/xhtml_epub2_format.rb index 7ae97f95..626eb79f 100644 --- a/lib/sisu/v6/xhtml_epub2_format.rb +++ b/lib/sisu/v6/xhtml_epub2_format.rb @@ -1362,12 +1362,13 @@ output_epub_cont_seg.close depth=@md.lvs[1] + @md.lvs[2] + @md.lvs[3] + @md.lvs[4] title=SanitizeXML.xml(@md.title.full) author=SanitizeXML.xml(@md.author) + dgst=(@md.dgst.is_a?(Array) and @md.dgst.length > 1) ? @md.dgst[1] : 'na' <<-WOK #{title} by #{author} - + @@ -1579,18 +1580,19 @@ output_epub_cont_seg.close else '' end f=SiSU_Env::FileOp.new(@md) + dgst=(@md.dgst.is_a?(Array) and @md.dgst.length > 1) ? @md.dgst[1] : 'na' <<-WOK <#{$ep[:o]}metadata xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:opf="http://www.idpf.org/2007/opf" xmlns:dcterms="http://purl.org/dc/terms/" xmlns:dc="http://purl.org/dc/elements/1.1/" - unique-identifier="urn:uuid:#{@md.dgst[1]}" version="2.0"> + unique-identifier="urn:uuid:#{dgst}" version="2.0"> #{@md.title.full} #{cover_image}#{author}#{editor}#{translator}#{illustrator}#{language}#{date_published}#{subject}#{rights} #{f.output_path.epub.url.gsub(/http:\/\//,'')}/#{f.base_filename.epub} - urn:uuid:#{@md.dgst[1]} - + urn:uuid:#{dgst} + WOK end -- cgit v1.2.3