Skip to content
This repository has been archived by the owner on May 8, 2022. It is now read-only.

Static Channel Number with wildcard naming #38

Closed
tunes0710 opened this issue Apr 29, 2022 · 11 comments
Closed

Static Channel Number with wildcard naming #38

tunes0710 opened this issue Apr 29, 2022 · 11 comments
Labels
enhancement New feature or request

Comments

@tunes0710
Copy link

I did add this as a request on the main xTeVe page, but it seems like this fork is actively worked on, so thought I would switch over and ask here :)

Is your feature request related to a problem? Please describe.
There are is a group of channels (PPV) whereby part of the channel name changes on a regular (daily basis)
So day one it may be
PPV1: Swimming championships
PPV2: Knitting live fron granny house
etc etc

So I add a filter, group = PPV and then in mapping, I set channel numbers and map a dummy xteve file to the channels

Then on day 2 it's changed
PPV1: Championship mowing
PPV2: Hot air ballooning world championships

When xteve does its' daily import, because the channel name is different, it loses its channel number and mapping (as it thinks it is a new channel) and because it has no XMLTV file associated with it, it then wouldn't be seen in NextPVR and Kodi etc..

Describe the solution you'd like
Is it possible that when you click on a channel in the mapping section to be able to have additional checkbox and input line under "channel description".
Tickbox saying "Allow wildcard?"
And the input line saying "Channel Wildcard"

So I could click on channel 3001 where the channel name currently reads PPV1: Swimming championships
Select allow wildcard
in in channel wildcard, enter "PPV1: *"
Meaning that he next day, when xteve updates and the imported channel name is now PPV1: Championship mowing
It will still know to assign it the channel 3001 amd use the XMLTV File: xTeVe Dummy and the XMLTV Channel 30 Minutes

As a further protection against it incorrectly naming other channels that may start PPV1 in.. it will also use the "group" that it is assigned to as another check... so will only match PPV1: * to 3001 if it's in the PPV group.

There may be a way to already do this? but if there is... I do not know what it is :(

@SCP002
Copy link
Owner

SCP002 commented Apr 29, 2022

Hello 👋

Most probably you've described the best solution to this problem.
Tomorrow (it's 2 PM at my timezone right now) I'll re-read this again and try to implement it.

By the way, here is another fork https://github.com/Fyb3roptik/PlexTeVe/tree/beta, it's author already did a lot of PPV-related work, so it's also worth checking out.

@SCP002 SCP002 pinned this issue Apr 29, 2022
@SCP002 SCP002 added the enhancement New feature or request label Apr 29, 2022
@SCP002 SCP002 closed this as completed in d29330c May 1, 2022
@SCP002 SCP002 unpinned this issue May 1, 2022
@SCP002
Copy link
Owner

SCP002 commented May 2, 2022

How it's implemented so far:
demo

For example you have a channel: PPV1: Swimming championships so we want to change it's name to PPV1: Random Thing Today instead of disappearing.

For this we have two new fields: Channel name update regex and Only by group regex.
Into the first field we write something like: ^PPV[ \-_]?1.*, here is the link with test and explaination for this regex. You can change it to your own.

For the channel PPV2: Knitting live fron granny house we write the following regular expression ^PPV[ \-_]?2.* (notice 1 become 2).

If we want to guard ourselves from accidental renames, then into the field Only by group regex we write something like: ^PPV Group, this way, if in the field Group Title (xteve.m3u) we have the group called PPV Group (we can modify it manually BTW), the channel will be renamed, otherwise it won't.

Side notes:

  • This feature is not in the latest release yet, but if you in a hurry, you always can compile the program by youself. See README.md.
  • Please be sure you have a backup before trying this feature out.
  • Please double check your regular expressions and before clicking Save, be sure the regex like ^PPV[ \-_]?4.* is not assigned to the channel with the name like PPV5: Hot air ballooning world championships.
  • Ensure only one channel with the specific number corresponding only one regular expression with that specific number. If you have two channels named PPV 10: Stars and PPV 10: Moon, I do not guarantee it will work properly.

@tunes0710
Copy link
Author

That is absolutely brilliant.
Thank you for implementing this.. it's seriously going to save me a regular headache!
You are a superstar!

@SCP002
Copy link
Owner

SCP002 commented May 2, 2022

I haven't tested it much, but let's hope it will work as intended.
Regular expressions are ... highly "volatile" thing, it's very easy to mess everything up with them in place, but I thought why not to use them to cover the cases when your provider all of a sudden changes prefixes from "PPV1:" to "PPV-1 : " or even worse, mixing and altering them between "PPV1:" and "Pay Per View [ProviderName] 1:" etc 🙄

@joshjryan
Copy link

@tunes0710 Just throwing this out there as another option: if the streaming URI for those name-changing channels stays the same, you can use this script to give each channel an ID. Then even though the name changes, xTeVe sees it as the same channel.

@SCP002
Copy link
Owner

SCP002 commented May 2, 2022

@tunes0710 @joshjryan can I ask for your opinions guys?
Currently, we have the following check whether to proceed with renaming or not:

if nameRx.MatchString(m3uChannel.Name) == false {
	// New channel name does not match the regex specified. Leaving name as it is.
	continue
}

I could modify this check, futurer restricting user to what type of renames can be done:

if nameRx.MatchString(m3uChannel.Name) == false || nameRx.MatchString(xepgChannel.Name) == false {
	// New Or Old channel name does not match the regex specified. Leaving name as it is.
	continue
}

So we prevent the following (accidental) rename, for example:
Channel PPV 5: Somthing with regex PPV 9.* next day becomes PPV 9: Somthing else.
Seems like a great move to prevent this.

But from the other side, let's say we know one channel has many (different) name aliases and provider changes them sometimes:
Channel number five national, 5 channel national. They both are the same thing, and one day user notices he/she lost Channel number five national and got new 5 channel national without mapping.
To prevent it, user can add a regex to indicate Channel number five national is allowed to be renamed to 5 channel national.
With current implementation this is possible.

So-o-o-o-o what do you think, more safety (change it) or more possibilities (leave it as it is)?

@Fyb3roptik
Copy link

I actually solved this with my fork! I will submit a PR!

@Fyb3roptik
Copy link

https://github.com/Fyb3roptik/PlexTeVe/tree/beta Has the code in question. It adds a setting to check Channel Name for PPV and then it adds the programme info for it and everything. You set XMLTV to Dummy then choose PPV

@Fyb3roptik
Copy link

Fyb3roptik commented May 2, 2022

Screen Shot 2022-05-02 at 5 06 17 PM

Screen Shot 2022-05-02 at 5 06 02 PM

@tunes0710
Copy link
Author

Wow, these updates sound great.
I look forward to trying them out in an upcoming release :)

@SCP002
Copy link
Owner

SCP002 commented May 4, 2022

@SCP002 SCP002 mentioned this issue May 5, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants