Skip to content

Commit

Permalink
Fixed another small issue I forgot about
Browse files Browse the repository at this point in the history
  • Loading branch information
Your Name committed Oct 21, 2024
1 parent 4aa3e53 commit 695938b
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 12 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<img src="https://i.imgur.com/FIGZdR3.png">
</p>

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).
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
13 changes: 10 additions & 3 deletions services/generate-xmltv.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<boolean> => {
const enabledProviders = await db.providers.count({enabled: true});

return enabledProviders > 1;
};

const formatEntryName = (entry: IEntry, usesMultiple: boolean) => {
let entryName = entry.name;

if (entry.feed) {
Expand Down Expand Up @@ -50,6 +55,8 @@ export const generateXml = async (linear = false): Promise<xml> => {
],
};

const useMultiple = await usesMultiple();

if (linear) {
for (const key in CHANNELS.MAP) {
const val = CHANNELS.MAP[key];
Expand Down Expand Up @@ -137,7 +144,7 @@ export const generateXml = async (linear = false): Promise<xml> => {
for (const entry of scheduledEntries) {
const channelNum = calculateChannelFromName(`${entry.channel}`);

const entryName = formatEntryName(entry);
const entryName = formatEntryName(entry, useMultiple);

wrap.tv.push({
programme: [
Expand Down
5 changes: 0 additions & 5 deletions services/networks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);

0 comments on commit 695938b

Please sign in to comment.