diff --git a/app/Rules/FuzzyBoolean.php b/app/Rules/FuzzyBoolean.php new file mode 100644 index 0000000..ec40d71 --- /dev/null +++ b/app/Rules/FuzzyBoolean.php @@ -0,0 +1,62 @@ + ['required', new CsvDateTime()], 'ノート' => 'nullable|string|max:500', 'オカズリンク' => 'nullable|url|max:2000', + '非公開' => ['nullable', new FuzzyBoolean()], + 'センシティブ' => ['nullable', new FuzzyBoolean()], ]); if ($validator->fails()) { @@ -88,6 +91,12 @@ class CheckinCsvImporter $ejaculation->note = str_replace(["\r\n", "\r"], "\n", $record['ノート'] ?? ''); $ejaculation->link = $record['オカズリンク'] ?? ''; $ejaculation->source = Ejaculation::SOURCE_CSV; + if (isset($record['非公開'])) { + $ejaculation->is_private = FuzzyBoolean::isTruthy($record['非公開']); + } + if (isset($record['センシティブ'])) { + $ejaculation->is_too_sensitive = FuzzyBoolean::isTruthy($record['センシティブ']); + } try { $tags = $this->parseTags($line, $record);