You are here

tv.nu.ini, add Movie to genre if isMovie eq true

4 posts / 0 new
Last post
Blob
Offline
Donator
Joined: 1 month
Last seen: 1 week
tv.nu.ini, add Movie to genre if isMovie eq true

Hi,

I'm looking in to modify the latest tv.nu.ini but the syntax is not simple for me.

The source material:
{"type":"broadcast","id":"1JUlfK-13-aG7","slug":"unstoppable","programId":"12997","isPlay":true,"isMovie":true,"isSeries":false,"isLive":false,"hasTrailer":true,"title":"Unstoppable","description":"Två järnvägsanställda män måste hitta ett sätt att stoppa ett obemannat, skenande tåg innan det krockar och sprider hela sin giftiga last.","imagePortrait":"https://new.static.tv.nu/52596867","imageLandscape":"https://new.static.tv.nu/37799641","year":2010,"genres":["Action","Drama"],"imdb":{"rating":"6.8","link":"http://www.imdb.com/title/tt0477080"},"playProviders":[{"name":"SF Anytime","slug":"sf-anytime","image":"https://new.static.tv.nu/17636537","url":"https://online.adservicemedia.dk/cgi-bin/click.pl?cid=6586&pid=27656&med..."},{"name":"Google Play","slug":"google-play","image":"https://new.static.tv.nu/41581928","url":"https://play.google.com/store/movies/details/Unstoppable?gl=SE&hl=en&id=..."},{"name":"iTunes","slug":"itunes","image":"https://new.static.tv.nu/18191306","url":"https://itunes.apple.com/se/movie/unstoppable-2010/id405185716?at=1010lu58"}],"broadcast":{"id":"1JUlfK-13-aG7","startTime":1594494000000,"endTime":1594501200000,"channel":{"name":"TV6","slug":"tv6","image":"https://new.static.tv.nu/47578026"}}}

The line from tv.nu.ini:
index_category.scrub{single(separator="","")|"genres":["||"],}

My Rexex replace wish:
"isMovie":true
Replace with: Movie

So I want to add a genre called Movie if isMovie eq true.
Just want to add "Movie" as an additional custom category after "Action" and "Drama"
How can I add this regex replace to the existing "index_category.scrub{single........" line

Thanks

Blackbear199
Offline
WG++ Team memberDonator
Joined: 4 years
Last seen: 2 hours

index_category.scrub {regex||(?:"genres":\["(.*?)"\]\|"isMovie":(true),)||}
index_category.modify {replace|","|\|}
index_category.modify {replace|true|Movie}

should do it i think(untested).

alternate method is to leave the index_category.scrub as original and add another(you are allowed to have multiple scrubs) so just add..

index_category.scrub {single(include="true")|"isMovie":||,|,}
index_category.modify {replace|true|Movie}

Blob
Offline
Donator
Joined: 1 month
Last seen: 1 week
Blackbear199 wrote:

index_category.scrub {regex||(?:"genres":\["(.*?)"\]\|"isMovie":(true),)||}
index_category.modify {replace|","|\|}
index_category.modify {replace|true|Movie}
should do it i think(untested).
alternate method is to leave the index_category.scrub as original and add another(you are allowed to have multiple scrubs) so just add..
index_category.scrub {single(include="true")|"isMovie":||,|,}
index_category.modify {replace|true|Movie}

Thanks Blackbear199, i tested this and it works :)
Where can I read some more about the syntax, how did you know that multiple scrups for the same thing was allowed for example ;)

index_category.scrub {single(include="true")|"isMovie":||,|,}
index_category.modify {replace|true|Movie}

Blackbear199
Offline
WG++ Team memberDonator
Joined: 4 years
Last seen: 2 hours

you can download the developer manual form the downloads page.
it explains everything.

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