From 0a02a719835d49ac27f03ffd4714a5d9806eacaf Mon Sep 17 00:00:00 2001 From: ro Date: Thu, 16 May 2024 16:07:36 -0600 Subject: [PATCH] mastdon csv export edits the csv exports for mastodon had some formatting issues that was making importing problematic, so those issues have been fixed so importing the doc is easier --- app/Http/Controllers/ExportController.php | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/app/Http/Controllers/ExportController.php b/app/Http/Controllers/ExportController.php index ec6bcf0..89c79d6 100644 --- a/app/Http/Controllers/ExportController.php +++ b/app/Http/Controllers/ExportController.php @@ -46,12 +46,12 @@ class ExportController extends Controller $sources = Source::where("active", true)->get(); if ($type == 'mastodon') { $columns = [ - 'domain', - 'severity', - 'public_comment', - 'reject_media', - 'reject_reports', - 'obfuscate', + '#domain', + '#severity', + '#public_comment', + '#reject_media', + '#reject_reports', + '#obfuscate', ]; }; @@ -65,8 +65,13 @@ class ExportController extends Controller //remove extra white space $comments = str_replace(["\n\r", "\n", "\r"], " ", $comments); $comments = str_replace(['"', "'"], "", $comments); + if ($location->rating == 'defederate') { + $rating = 'suspend'; + } else { + $rating = $location->rating; + } //add to the export list - array_push($list, [$location->url, $location->rating, $comments, "FALSE", "FALSE", "FALSE"]); + array_push($list, [$location->url, $rating, $comments, "FALSE", "FALSE", "FALSE"]); } } }