Commit 5d4bd716 authored by John Long's avatar John Long

Feed: Add support for treating arbitrary feeds as premium

Some shows like True Crime Garage have their archives available on Stitcher for
free.

Ticket: N/A
parent b5b2aeb6
Pipeline #65065076 passed with stages
in 2 minutes and 6 seconds
......@@ -20,3 +20,9 @@ DB_PASSWORD=secret
CACHE_DRIVER=file
QUEUE_CONNECTION=sync
REDIS_HOST=127.0.0.1
# Feeds that should be supported, even if they're detected as free
# Comma delimited
FEED_BYPASS=""
......@@ -51,7 +51,12 @@ class Feed extends Model
\SimpleXMLElement $element,
?Feed $feed = null
): bool {
if ($feed !== null && (int)$element['id'] != $feed->id) {
$bypassed_feeds = explode(',', env('FEED_BYPASS', ''));
if (in_array((int)$element['id'], $bypassed_feeds)) {
$is_premium = true;
} elseif ($feed !== null && (int)$element['id'] != $feed->id) {
$is_premium = false;
} elseif ($element['authRequired'] && $element['authRequired']->__toString()) {
$is_premium = false;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment