Files
wp-donations/includes/Overlay/AlertMediaSource.php
T
shadowdaoandClaude Sonnet 5.5 2c16a9ebbb
Test and Release / test (push) Successful in 1m20s
Test and Release / release (push) Successful in 4s
Alert media: images/GIFs/videos/sounds tied to donation amount or reward; release tag collision fix
- Alerts\Resolver/Media/Template/AlertMedia/DefInput/DefRepository; Alerts admin screen with Media Library picker and live preview
- Overlay: media resolved server-side from attachment IDs (MIME whitelist), playback with timeouts and autoplay-failure fallbacks
- Workflow: pick the next free minute if the version tag already exists (two pushes in one minute failed 'Create release')

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-15 13:01:31 -08:00

27 lines
811 B
PHP

<?php
declare( strict_types=1 );
namespace StreamGoals\Overlay;
/** Optional capability: configurable alert media (definitions, triggered rewards, attachment lookup). */
interface AlertMediaSource {
/** Enabled alert definitions, raw rows. Called at most once per request. */
public function alertDefs(): array;
/**
* Rewards triggered per donation, one lookup for the whole page.
*
* @param int[] $donationIds
* @return array<int,array<int,array{action_id:int,amount_minor:int,title:string}>> donation id => rewards
*/
public function triggeredActionsFor( array $donationIds ): array;
/**
* Server-side attachment lookup (the only place media URLs come from). Null when it is gone.
*
* @return array{url:string,mime:string}|null
*/
public function attachment( int $id ): ?array;
}