mirror of
https://github.com/aljazceru/ditto.git
synced 2026-01-12 10:04:20 +01:00
feat: add TREND_LANGUAGES environment variable
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
import os from 'node:os';
|
||||
import ISO6391, { LanguageCode } from 'iso-639-1';
|
||||
import * as dotenv from '@std/dotenv';
|
||||
import { getPublicKey, nip19 } from 'nostr-tools';
|
||||
import { z } from 'zod';
|
||||
@@ -247,6 +248,10 @@ class Conf {
|
||||
static get zapSplitsEnabled(): boolean {
|
||||
return optionalBooleanSchema.parse(Deno.env.get('ZAP_SPLITS_ENABLED')) ?? false;
|
||||
}
|
||||
/** Filter trends by languages. */
|
||||
static get trendLanguages(): LanguageCode[] | undefined {
|
||||
return Deno.env.get('TREND_LANGUAGES')?.split(',')?.filter(ISO6391.validate) as LanguageCode[];
|
||||
}
|
||||
/** Cache settings. */
|
||||
static caches = {
|
||||
/** NIP-05 cache settings. */
|
||||
|
||||
Reference in New Issue
Block a user