From 1c0c795fc39db787e297b2e7913bacee9cc9ffcd Mon Sep 17 00:00:00 2001
From: Your Name
Date: Fri, 29 Nov 2024 09:14:16 -0700
Subject: [PATCH] Search for NFL events after enabling Twitch
---
README.md | 2 +-
package-lock.json | 4 ++--
package.json | 2 +-
services/nfl-handler.ts | 4 ++--
services/providers/nfl/index.tsx | 5 +++++
5 files changed, 11 insertions(+), 6 deletions(-)
diff --git a/README.md b/README.md
index f60307a..53a546c 100644
--- a/README.md
+++ b/README.md
@@ -2,7 +2,7 @@
-Current version: **4.1.2**
+Current version: **4.1.3**
# About
This takes ESPN+, ESPN, FOX Sports, CBS Sports, Paramount+, Gotham Sports, NFL, B1G+, NESN, Mountain West, FloSports, or MLB.tv programming and transforms it into a "live TV" experience with virtual linear channels. It will discover what is on, and generate a schedule of channels that will give you M3U and XMLTV files that you can import into something like [Jellyfin](https://jellyfin.org) or [Channels](https://getchannels.com).
diff --git a/package-lock.json b/package-lock.json
index 96cdc43..3d1a51e 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -1,12 +1,12 @@
{
"name": "eplustv",
- "version": "4.1.2",
+ "version": "4.1.3",
"lockfileVersion": 2,
"requires": true,
"packages": {
"": {
"name": "eplustv",
- "version": "4.1.2",
+ "version": "4.1.3",
"license": "MIT",
"dependencies": {
"@hono/node-server": "^1.13.1",
diff --git a/package.json b/package.json
index 3087a5f..6cd1687 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
{
"name": "eplustv",
- "version": "4.1.2",
+ "version": "4.1.3",
"description": "",
"scripts": {
"start": "ts-node -r tsconfig-paths/register index.tsx",
diff --git a/services/nfl-handler.ts b/services/nfl-handler.ts
index 3fece83..3e2aa0d 100644
--- a/services/nfl-handler.ts
+++ b/services/nfl-handler.ts
@@ -10,7 +10,7 @@ import {configPath} from './config';
import {useNfl} from './networks';
import {ClassTypeWithoutMethods, IEntry, IHeaders, IProvider} from './shared-interfaces';
import {db} from './database';
-import {getRandomUUID} from './shared-helpers';
+import {getRandomHex, getRandomUUID} from './shared-helpers';
import {useLinear} from './channels';
import {debug} from './debug';
@@ -602,7 +602,7 @@ class NflHandler {
headers: {
'Client-id': TWITCH_CLIENT_ID,
'User-Agent': userAgent,
- 'X-Device-Id': this.twitchDeviceId,
+ 'X-Device-Id': this.twitchDeviceId || getRandomHex(),
},
},
);
diff --git a/services/providers/nfl/index.tsx b/services/providers/nfl/index.tsx
index 64bf21d..6498bec 100644
--- a/services/providers/nfl/index.tsx
+++ b/services/providers/nfl/index.tsx
@@ -75,6 +75,11 @@ nfl.put('/auth/:provider', async c => {
if (!enabled || provider === 'twitch') {
const {linear_channels, tokens} = await db.providers.update>({name: 'nfl'}, {$set: {tokens: updatedTokens}}, {returnUpdatedDocs: true});
+ if (provider === 'twitch' && enabled) {
+ // Kickoff event scheduler
+ await scheduleEvents();
+ }
+
return c.html();
}