You are here

(style=sentence) not working?

5 posts / 0 new
Last post
mariusz89b
Offline
Donator
Joined: 7 years
Last seen: 1 year
(style=sentence) not working?

Hi, I got some issue when grabbing some words don't get capitalized when suppose to. Can you guys help me out?

Look at "serial SF:" should be "Serial SF:"

The "Serial kryminalny:" is correct

[ Debug ] Element: CATEGORY
[ Debug ] Modify
[ Debug ] command & arguments : cleanup(debug style=sentence)
[ Debug ] Element value before operation:
[ Debug ] serial SF:
[ Debug ] Element value after operation:
[ Debug ] serial SF:
[ Debug ] Debugging information SiteIni
[ Debug ] Element: CATEGORY
[ Debug ] Modify
[ Debug ] command & arguments : cleanup(debug style=sentence)
[ Debug ] Element value before operation:
[ Debug ] serial kryminalny:
[ Debug ] Element value after operation:
[ Debug ] Serial kryminalny:
[ Debug ] Debugging information SiteIni

mariusz89b
Offline
Donator
Joined: 7 years
Last seen: 1 year

Ok I see but the thing is I only want the first separate category to use style=sentence, the second category should use lowercase letters. Is it possible to force only to apply capitalized letter to the first category?

With your modification it looks like this, both categories are capitiliezed:

< category lang="pl" >Serial< /category>
< category lang="pl" >Fantasy< /category>

Problem is that I need to use two categories because my script addon for kodi is only reading the first category so that I don't need to add hundreds of different category names just the basic ones like Serial.

mariusz89b
Offline
Donator
Joined: 7 years
Last seen: 1 year

I'm sorry for not being clear, I need to have the multi value element. My point is if it is possible that only the first element is capitalized and the second element have lowercase letters.

Ex.

< span class="first-word">program< /span> rozrywkowy (kabaret): < /strong>

Result:

< category lang="pl">Program< /category>
< category lang="pl">rozrywkowy / Kabaret< /category>

mariusz89b
Offline
Donator
Joined: 7 years
Last seen: 1 year

Big thanks blackbear199 as always you are of great help. The only thing left for me is I'm not really sure how to scrub only the information between brackets ex. (kabaret), my regex don't seem to work (see temp_4).

This is what I came up with.

category.scrub {regex||< span class="first-word">(.*?)< /span>||}
category.modify {cleanup(style=sentence)}
category.modify {remove|(}
category.modify {remove|)}
category.modify {addstart('category' "")|$ADDON[script.mtvguide 30163]}

temp_3.scrub {regex||< span class="first-word">(.*?)||}
temp_3.modify {remove(type=regex)|.*< /span>}
temp_3.modify {remove(type=regex)|\(.*}
temp_3.modify {replace|SF|science fiction}
temp_3.modify {cleanup(tags="<"">")}

temp_4.scrub {regex||< span class="first-word">\(.*\)< /strong>||}
temp_4.modify {cleanup(style=sentence)}
temp_4.modify {addstart('temp_4' not "")| / }
temp_3.modify {addend('temp_4' not "")|\|'temp_4'}
category.modify {addend('temp_3' not "")|\|'temp_3'}
category.modify {remove(type=regex)|\W$}

mariusz89b
Offline
Donator
Joined: 7 years
Last seen: 1 year

Big thanks! Yes the space is only for forum. :)

Here is final result for those who are interested:

category.scrub {regex||< span class="first-word">(.*?)< /span>||}
category.modify {cleanup(style=sentence)}
category.modify {remove|(}
category.modify {remove|)}
category.modify {addstart('category' "")|$ADDON[script.mtvguide 30163]}

temp_3.scrub {regex||< span class="first-word">(.*?)< /strong>||}
temp_3.modify {remove(type=regex)|.*< /span>}
temp_3.modify {remove(type=regex)|\(.*}
temp_3.modify {replace|SF|science fiction}
temp_3.modify {cleanup(tags="< "" >")}

temp_4.scrub {regex||< span class="first-word">[^\(]*(\(.*?\)[^<]*)< /strong>||}
temp_4.modify {cleanup(style=sentence)}
temp_4.modify {remove|(}
temp_4.modify {remove|)}
temp_4.modify {addstart('temp_4' not "")| / }
temp_3.modify {addend('temp_4' not "")|\|'temp_4'}
category.modify {addend('temp_3' not "")|\|'temp_3'}
category.modify {remove(type=regex)|\W$}

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