From a1f02d4baa41b0cd5404faa63bec12bb01f87dbd Mon Sep 17 00:00:00 2001 From: Sam Date: Mon, 3 Aug 2015 17:35:35 +1000 Subject: [PATCH] correct logic, add missing permalink creator --- script/import_scripts/lithium.rb | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/script/import_scripts/lithium.rb b/script/import_scripts/lithium.rb index 030ebc46776..8f12331f820 100644 --- a/script/import_scripts/lithium.rb +++ b/script/import_scripts/lithium.rb @@ -63,6 +63,7 @@ class ImportScripts::Lithium < ImportScripts::Base import_accepted_answers import_pms close_topics + create_permalinks post_process_posts end @@ -728,9 +729,6 @@ SQL return nil end - def to_markdown(html) - end - def post_process_posts puts "", "Postprocessing posts..." @@ -773,15 +771,16 @@ SQL # we need an upload here upload_name = $1 if uri.path =~ /image-id\/([^\/]+)/ + if upload_name + png = UPLOAD_DIR + "/" + upload_name + ".png" + jpg = UPLOAD_DIR + "/" + upload_name + ".jpg" - png = UPLOAD_DIR + "/" + upload_name + ".png" - jpg = UPLOAD_DIR + "/" + upload_name + ".jpg" - - # check to see if we have it - if File.exist?(png) - image = png - elsif File.exists?(jpg) - image = jpg + # check to see if we have it + if File.exist?(png) + image = png + elsif File.exists?(jpg) + image = jpg + end end if image