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;
|
namespace App\Observers;
|
||||||
|
|
||||||
use App\Enums\LibraryItemType;
|
|
||||||
use App\Models\LibraryItem;
|
use App\Models\LibraryItem;
|
||||||
use App\Traits\NostrTrait;
|
use App\Traits\NostrTrait;
|
||||||
use Exception;
|
use Exception;
|
||||||
@@ -21,9 +20,13 @@ class LibraryItemObserver
|
|||||||
$libraryItem->setStatus('published');
|
$libraryItem->setStatus('published');
|
||||||
|
|
||||||
if (!$libraryItem->news) {
|
if (!$libraryItem->news) {
|
||||||
if ($libraryItem->whereDoesntHave('libraries',
|
if (
|
||||||
|
$libraryItem->type !== 'bindle'
|
||||||
|
&& $libraryItem
|
||||||
|
->whereDoesntHave('libraries',
|
||||||
fn($query) => $query->where('libraries.is_public', false))
|
fn($query) => $query->where('libraries.is_public', false))
|
||||||
->exists()) {
|
->exists()
|
||||||
|
) {
|
||||||
$this->publishOnNostr($libraryItem, $this->getText($libraryItem));
|
$this->publishOnNostr($libraryItem, $this->getText($libraryItem));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user