mirror of
https://github.com/Einundzwanzig-Podcast/einundzwanzig-portal.git
synced 2025-12-11 06:46:47 +00:00
exclude bindles from nostr
This commit is contained in:
@@ -2,7 +2,6 @@
|
||||
|
||||
namespace App\Observers;
|
||||
|
||||
use App\Enums\LibraryItemType;
|
||||
use App\Models\LibraryItem;
|
||||
use App\Traits\NostrTrait;
|
||||
use Exception;
|
||||
@@ -21,9 +20,13 @@ class LibraryItemObserver
|
||||
$libraryItem->setStatus('published');
|
||||
|
||||
if (!$libraryItem->news) {
|
||||
if ($libraryItem->whereDoesntHave('libraries',
|
||||
fn($query) => $query->where('libraries.is_public', false))
|
||||
->exists()) {
|
||||
if (
|
||||
$libraryItem->type !== 'bindle'
|
||||
&& $libraryItem
|
||||
->whereDoesntHave('libraries',
|
||||
fn($query) => $query->where('libraries.is_public', false))
|
||||
->exists()
|
||||
) {
|
||||
$this->publishOnNostr($libraryItem, $this->getText($libraryItem));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user