From 695938b2201ff65c58409814f92ccb6ffbbd4a47 Mon Sep 17 00:00:00 2001
From: Your Name
Date: Mon, 21 Oct 2024 11:54:00 -0600
Subject: [PATCH] Fixed another small issue I forgot about
---
README.md | 2 +-
package-lock.json | 4 ++--
package.json | 2 +-
services/generate-xmltv.ts | 13 ++++++++++---
services/networks.ts | 5 -----
5 files changed, 14 insertions(+), 12 deletions(-)
diff --git a/README.md b/README.md
index 3f452bf..a52c92c 100644
--- a/README.md
+++ b/README.md
@@ -2,7 +2,7 @@
-Current version: **4.0.1**
+Current version: **4.0.2**
# About
This takes ESPN/ESPN+, FOX Sports, Paramount+, MSG+, NFL+, B1G+, NESN, Mountain West, FloSports, CBS Sports, 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 d5a94a9..208b32f 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -1,12 +1,12 @@
{
"name": "eplustv",
- "version": "4.0.1",
+ "version": "4.0.2",
"lockfileVersion": 2,
"requires": true,
"packages": {
"": {
"name": "eplustv",
- "version": "4.0.1",
+ "version": "4.0.2",
"license": "MIT",
"dependencies": {
"@hono/node-server": "^1.13.1",
diff --git a/package.json b/package.json
index 9d38310..8a57931 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
{
"name": "eplustv",
- "version": "4.0.1",
+ "version": "4.0.2",
"description": "",
"scripts": {
"start": "ts-node -r tsconfig-paths/register index.tsx",
diff --git a/services/generate-xmltv.ts b/services/generate-xmltv.ts
index 02819b2..de242a2 100644
--- a/services/generate-xmltv.ts
+++ b/services/generate-xmltv.ts
@@ -3,13 +3,18 @@ import xml from 'xml';
import moment from 'moment';
import {db} from './database';
-import {usesMultiple} from './networks';
import {calculateChannelFromName, CHANNELS, LINEAR_START_CHANNEL, NUM_OF_CHANNELS, START_CHANNEL} from './channels';
import {IEntry} from './shared-interfaces';
const baseCategories = ['HD', 'HDTV', 'Sports event', 'Sports'];
-const formatEntryName = (entry: IEntry) => {
+const usesMultiple = async (): Promise => {
+ const enabledProviders = await db.providers.count({enabled: true});
+
+ return enabledProviders > 1;
+};
+
+const formatEntryName = (entry: IEntry, usesMultiple: boolean) => {
let entryName = entry.name;
if (entry.feed) {
@@ -50,6 +55,8 @@ export const generateXml = async (linear = false): Promise => {
],
};
+ const useMultiple = await usesMultiple();
+
if (linear) {
for (const key in CHANNELS.MAP) {
const val = CHANNELS.MAP[key];
@@ -137,7 +144,7 @@ export const generateXml = async (linear = false): Promise => {
for (const entry of scheduledEntries) {
const channelNum = calculateChannelFromName(`${entry.channel}`);
- const entryName = formatEntryName(entry);
+ const entryName = formatEntryName(entry, useMultiple);
wrap.tv.push({
programme: [
diff --git a/services/networks.ts b/services/networks.ts
index 3ed3797..c8dfbea 100644
--- a/services/networks.ts
+++ b/services/networks.ts
@@ -80,8 +80,3 @@ export const useMountainWest = process.env.MTNWEST?.toLowerCase() === 'true' ? t
export const requiresEspnProvider =
useEspn1 || useEspn2 || useEspn3 || useEspnU || useSec || useSecPlus || useAccN || useAccNx || useEspnews;
-
-export const usesMultiple =
- ((useFoxSports || useMLBtv || useParamount.plus || useB1GPlus || useFloSports || useMsgPlus || useNfl.plus) &&
- (requiresEspnProvider || useEspnPlus)) ||
- (requiresEspnProvider && useEspnPlus);