From a94dfbb550e0777e37b97d84bd438a5b4b3b6c0d Mon Sep 17 00:00:00 2001 From: saint Date: Thu, 27 Jun 2024 15:42:40 +1000 Subject: [PATCH] v0.16.5 Remove duplicate images from user_profile.bio_raw --- gossamer_forums.rb | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/gossamer_forums.rb b/gossamer_forums.rb index 7f0a93c..937860f 100644 --- a/gossamer_forums.rb +++ b/gossamer_forums.rb @@ -1,5 +1,5 @@ # gossamer threads migration-import code -# v0.16.4 +# v0.16.5 require 'mysql2' require 'open-uri' @@ -515,6 +515,11 @@ class GossamerForumsImporter < ImportScripts::Base resized_temp_file.close resized_temp_file.unlink end + + # Check for and remove exact duplicate image markdown strings + user.user_profile.bio_raw = user.user_profile.bio_raw.split("\n\n").uniq.join("\n\n") + user.user_profile.save! + print "Importing files for user #{user.username}... Done.\n" end