mirror of
https://github.com/Einundzwanzig-Podcast/einundzwanzig-portal.git
synced 2025-12-15 07:06:47 +00:00
TTS
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
namespace App\Http\Livewire\News;
|
||||
|
||||
use App\Models\LibraryItem;
|
||||
use App\Traits\HasTextToSpeech;
|
||||
use App\Traits\NostrTrait;
|
||||
use Livewire\Component;
|
||||
use RalphJSmit\Laravel\SEO\Support\SEOData;
|
||||
@@ -12,6 +13,7 @@ class ArticleOverview extends Component
|
||||
{
|
||||
use Actions;
|
||||
use NostrTrait;
|
||||
use HasTextToSpeech;
|
||||
|
||||
public $perPage = 9;
|
||||
|
||||
|
||||
@@ -4,12 +4,15 @@ namespace App\Http\Livewire\News\Form;
|
||||
|
||||
use App\Models\LibraryItem;
|
||||
use App\Traits\HasTagsTrait;
|
||||
use Illuminate\Support\Facades\File;
|
||||
use Illuminate\Validation\Rule;
|
||||
use Livewire\Component;
|
||||
use Livewire\WithFileUploads;
|
||||
use WireUi\Traits\Actions;
|
||||
|
||||
class NewsArticleForm extends Component
|
||||
{
|
||||
use Actions;
|
||||
use HasTagsTrait;
|
||||
use WithFileUploads;
|
||||
|
||||
@@ -104,6 +107,20 @@ class NewsArticleForm extends Component
|
||||
public function save()
|
||||
{
|
||||
$this->validate();
|
||||
|
||||
if (str($this->libraryItem->value)->contains('Turm')) {
|
||||
$text = sprintf("
|
||||
Markus Turm hat deinen Artikel geprüft aber nicht freigegeben.
|
||||
Dein Artikel ist leider nicht toxisch genug.
|
||||
Außerdem musst du mindestens 2 Provokation pro Absatz einbauen, um die gewünschte Turm Qualität zu erreichen.
|
||||
");
|
||||
File::put(storage_path('app/public/tts/news_error.txt'), $text);
|
||||
dispatch(new \App\Jobs\CodeIsSpeech('news_error', false))->delay(now()->addSecond());
|
||||
$this->notification()->error('Markus Turm hat deinen Artikel abgelehnt.');
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
$this->libraryItem->save();
|
||||
|
||||
$this->libraryItem->syncTagsWithType(
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
namespace App\Http\Livewire\News;
|
||||
|
||||
use App\Models\LibraryItem;
|
||||
use App\Traits\HasTextToSpeech;
|
||||
use App\Traits\LNBitsTrait;
|
||||
use Carbon\Carbon;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
@@ -17,6 +18,7 @@ class InternArticleView extends Component
|
||||
{
|
||||
use Actions;
|
||||
use LNBitsTrait;
|
||||
use HasTextToSpeech;
|
||||
|
||||
public LibraryItem $libraryItem;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user