You are here

How to use "category.modify"

7 posts / 0 new
Last post
MariuCh
Offline
Joined: 5 years
Last seen: 11 months
How to use "category.modify"

Hello all,
I am trying to adjust the attached site.ini to handle the guide.xml output file in TVHeadend - change polish "category" to english equivalents.
In the site_modified.ini file, I added three lines (marked as "* Modified by MariuCh"):
index_category.modify {replace(type=regex)|"^Seriale$"|Movie / drama}
index_category.modify {replace(type=regex)|"^serial$"|Movie / drama}
index_category.modify {replace(type=regex)|"^kryminalny$"|Detective / Thriller}

I wanted the above modifications to change the following three lines in the guide.xml file (added quotes):
"<"category lang="pl">Seriale/"<"category">"
"<"category lang="pl">serial/"<"category">"
"<"category lang="pl">kryminalny/"<"category">"

Unfortunately, after the changes, the interesting part of the guide.xml file looks like this (added quotes):
"<"category lang="pl">Movie / drama/"<"category">"
"<"category lang="pl">serial/"<"category">"
"<"category lang="pl">kryminalny/"<"category">"

So my modification changes only the first of three lines? Why is it and how to change it?
I do not understand why "category" is divided into three lines ...?
Do I need to change "lang = pl" to "lang = en" for TVHeadend?

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

if you look at your ini u will see that there is..

index_category.scrub
and
category.scrub

this means that category values are from 2 different places,the index page and the details page.
using your example above..

"<"category lang="pl">Seriale/"<"category">"
"<"category lang="pl">serial/"<"category">"
"<"category lang="pl">kryminalny/"<"category">"

"<"category lang="pl">Seriale/"<"category">" ==> index page category

"<"category lang="pl">serial/"<"category">" ======> details page category
"<"category lang="pl">kryminalny/"<"category">" ===> details page category

since you are only modifying the index element this is why only the first value is changed.

a easier was to do this would be to disable the index_caregory.scrub line(add a * to the beginning of the line).
i see no sense in haveing both index category and details category scrubs, it gets "Seriale" from the index page and "serial" from the details page.there are the same category so why have it twice.

so if you disabled the index_category.scrub then you would be left with this..

"<"category lang="pl">serial/"<"category">"
"<"category lang="pl">kryminalny/"<"category">"

change ur modify line to edit the details category(remove index_ prefix)..

category.modify {replace(type=regex)|"^serial$"|Movie / drama}
category.modify {replace(type=regex)|"^kryminalny$"|Detective / Thriller}

and you should end up with..

"<"category lang="pl">Movie / drama/"<"category">"
"<"category lang="pl">Detective / Thriller/"<"category">"

which is what u wanted.

MariuCh
Offline
Joined: 5 years
Last seen: 11 months

Thank you.

After modifications results are:
"<"category lang="pl">Movie / drama"<"/category">"
"<"category lang="pl">Detective / Thriller"<"/category">"
So the first and third lines appear, the second row is skipped. Perhaps this is due to the fact that the second would be identical to the first (?).

Another issue is that the second and third lines should be in one line - the "serial kryminalny" is a two-word name, so it would be optimal to replace the "serial kryminalny" (second and third lines) with "detective / thiller".
I do not know why the author of this "ini" separates it into two lines (?)
How do you get a combination of these two lines and replace the whole expression with English equivalents?

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

change this line..

category.modify {replace(type=regex)|<[^>]*>|\|}
to
category.modify {cleanup(tags="<"">")}

this will keep things like "serial kryminalny" original instead of splitting them into separate categories.

MariuCh
Offline
Joined: 5 years
Last seen: 11 months

Again, thank you very much - now it works OK.
I also use another site - "ini" attached. It shows that you are the Author :)
And in this case also "category" is divided into two lines, for example:
"<"category lang = "pl"> Program "<"/ category">"
"<"category lang = "pl"> muzyczny"<"/ category">"

How to split both lines in this case?

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

remove (separator=" ")
from the index_category.scrub line.

MariuCh
Offline
Joined: 5 years
Last seen: 11 months

Thank you very much for help.

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