You are here

regex Expressions in Rules,please help me.

15 posts / 0 new
Last post
bahala520
Offline
Joined: 7 years
Last seen: 5 years
regex Expressions in Rules,please help me.

For example, the title format is

EP01 ******
EP103 *****

I want to move the EP and the following digital content to the end of the title.

****** EP01
***** EP103

Blackbear199
Offline
Blackbear199's picture
WG++ Team memberDonator
Joined: 9 years
Last seen: 3 hours

episode.modify {substring(type=regex)|'title' "\s*(EP\d+)"}
title.modify {remove('episode' not "")| 'episode'}
title.modify {addend('episode' not "")| 'episode'}

\s*(EP\d+)

\s* - zero or more spaces
( - start of capture
EP\d+ - the letters EP followed by 1 or more numbers
) - end of capture

bahala520
Offline
Joined: 7 years
Last seen: 5 years

The results have not changed.

Blackbear199
Offline
Blackbear199's picture
WG++ Team memberDonator
Joined: 9 years
Last seen: 3 hours

u got what u asked for..
like usual u provide half the information thats needed.

if this is the index elements they all need index_ added...

and you also have to do it for details title like above.
if a details pages exists(and has this same episode info) the details title always overwrites the index title so if you do the above to the index title and not the details title it will be overwritten with the unedited title from the details page.

bahala520
Offline
Joined: 7 years
Last seen: 5 years

episode.modify {substring(type=regex)|'index_title' "\s*(EP\d+)"}
index_title.modify {remove('episode' not "")| 'episode'}
index_title.modify {addend('episode' not "")| 'episode'}

Blackbear199
Offline
Blackbear199's picture
WG++ Team memberDonator
Joined: 9 years
Last seen: 3 hours

u have to add index_ to episode element also..all 5 places.

bahala520
Offline
Joined: 7 years
Last seen: 5 years

Another problem is how to adjust the data time collected by the system five minutes slower than that of the TV channel.

Blackbear199
Offline
Blackbear199's picture
WG++ Team memberDonator
Joined: 9 years
Last seen: 3 hours

thats a very unusual thing to happen...

so u need the start time reduced by 5 minutes in the epg data?

index_start.modify {calculate(format=time,HH:mm)|00:05 -}

if you also have stop time u need to do the same for it.

bahala520
Offline
Joined: 7 years
Last seen: 5 years

According to your method, the result is that the start time has not changed, the end time has been reduced by 5 minutes, how to make the start time 5 minutes earlier?

bahala520
Offline
Joined: 7 years
Last seen: 5 years

index_duration.modify {calculate(debug format=time,HH:mm)|00:05 -}

bahala520
Offline
Joined: 7 years
Last seen: 5 years

index_duration.modify {calculate(format=time,HH:mm)|00:05 -}

Blackbear199
Offline
Blackbear199's picture
WG++ Team memberDonator
Joined: 9 years
Last seen: 3 hours

that wont do anything except make the ending 5 minutes earlier.

post the debug from your log for this..

index_start.modify {calculate(debug format=time,HH:mm)|00:05 -}

u may have to do it this way..

index_start.modify {calculate(debug format=time,HH:mm)|'index_start' 00:05 -}

Blackbear199
Offline
Blackbear199's picture
WG++ Team memberDonator
Joined: 9 years
Last seen: 3 hours

ur all messed up,here howto do it..

index_start.scrub {single|"displayDateTime":"||.0"|.0"}
index_duration.scrub {single|"displayDuration":"||:00",|:00",}

index_start.modify {calculate(format=date,unix)}
index_start.modify {calculate(debug format=F0)|300 -}

unix time is in seconds..
5 min x 60sec/min = 300

bahala520
Offline
Joined: 7 years
Last seen: 5 years

OK solved it.

Blackbear199
Offline
Blackbear199's picture
WG++ Team memberDonator
Joined: 9 years
Last seen: 3 hours

btw does ur sort work for index_showsplit?
any messages in log about this?

see 4.6.4.9 Sort in the manual.

Log in or register to post comments

Brought to you by Jan van Straaten

Program Development - Jan van Straaten ------- Web design - Francis De Paemeleere
Supported by: servercare.nl