Update repo URL, Redis client key, and add environment variable support

Co-authored-by: 20250410303 <20250410303@stu.fosu.edu.cn>
pull/6/head
Cursor Agent 2025-08-29 07:59:44 +00:00
parent 672a386d2c
commit 7f73c00e0a
3 changed files with 10 additions and 4 deletions

File diff suppressed because one or more lines are too long

View File

@ -35,7 +35,10 @@ function VersionDisplay() {
return (
<button
onClick={() =>
window.open('https://github.com/senshinya/MoonTV', '_blank')
window.open(
process.env.NEXT_PUBLIC_REPO_URL || 'https://github.com/katelya77/KatelyaTV',
'_blank'
)
}
className='absolute bottom-4 left-1/2 transform -translate-x-1/2 flex items-center gap-2 text-xs text-gray-500 dark:text-gray-400 transition-colors cursor-pointer'
>

View File

@ -287,8 +287,9 @@ export class RedisStorage implements IStorage {
// 单例 Redis 客户端
function getRedisClient(): RedisClientType {
const globalKey = Symbol.for('__MOONTV_REDIS_CLIENT__');
let client: RedisClientType | undefined = (global as any)[globalKey];
const legacyKey = Symbol.for('__MOONTV_REDIS_CLIENT__');
const globalKey = Symbol.for('__KATELYATV_REDIS_CLIENT__');
let client: RedisClientType | undefined = (global as any)[globalKey] || (global as any)[legacyKey];
if (!client) {
const url = process.env.REDIS_URL;
@ -349,6 +350,8 @@ function getRedisClient(): RedisClientType {
connectWithRetry();
(global as any)[globalKey] = client;
// 同步旧键,保持兼容
(global as any)[legacyKey] = client;
}
return client;