Inverter Path / Replace Operator Problem #193
Replies: 7 comments 9 replies
-
Hi and thanks for the good words but yes, this is the best epg grabber ever made 😄 Anyway, what you asked is possible with inverter module but requires some experience since it is a bit complicated. I will explain step by step so you can modify or directly use as it is based on your needs. First of all, star rating shall be in "value/limit" format as per xmltv.dtd and Tempest applies the same standard so some commands such as ||#max# will not work for this format. Up to now, I only saw 4 types of limit as "/4", "/5", "/10" and "/100" so to convert all into 5 stars limit, you need to calculate them into a fixed format such as "/10" by adding below string to top of inverter-path;
so all our star-rating values converted to "/10" limiter such as "6.7/10", Now you need to replace them with star symbols based on a logic. It should go from lowest value to highest since replace operations will be performed with first-in/first-out sequence. The second input of inverter-path will be;
this will replace scores upto but not including 3 values such as 1.6/10 or 2.4/10 into "★☆☆☆☆" and stars will increase on each range of "3-4" , "5-6", "7-8" and "9-10" since above 2 following commands belong to same element, you can merge them into single block as;
Now, star-rating value is completely converted to star order. Next step is to move it into another element since players will not recognize it in this format.
will move it to the end of description with a new line and "Stars[{system}]: ★★★★☆" format. {system} there is a dynamic variable which takes the star-rating system name from siteconfig and replace it so if star-rating system is defined as IMDb in siteconfig, it will be shown as "Stars[IMDb]: ★★★★☆" or you can hardcode it as you want. And finally, you can remove star-rating type from the xml file since it has been moved to desc and remaining tag is useless in that format so you can add below command to end of inverter path;
This is how it looked in my file after conversion; Edit: btw I noticed you are using star symbol in something like html format. I used only unicode values for not having issue with some players. Not all the players may render your star symbol but all will render mine as fine. You may replace the stars on above code with your symbols. |
Beta Was this translation helpful? Give feedback.
-
you are welcome 👍 |
Beta Was this translation helpful? Give feedback.
-
I have another question on top of that if I may :). Thanks for getting in touch already! |
Beta Was this translation helpful? Give feedback.
-
Hi; Siteconfig that I prepared for tvspielfilm does not belong to their website and there is no imdb rating on the source that I am using. Maybe in the future I can prepare another siteconfig for their website but it will not be fast as expected since imdb ratings are located in additional show pages which means 1 additional url will be called for each show same as texxas.de siteconfig does. |
Beta Was this translation helpful? Give feedback.
-
One (hopefully) last question K-vanc if I may. Is there a way to limit the amount of characters in inverter parh for let‘s say „desc“ in an elegant way? %^.{1,50} Is there a way to put that into the inverter path? I tried some ways, but I fail. Thanks for your help again dude! ps: I studied the manual carefully but either I‘m overseeing something or I don’t get it. 😂 |
Beta Was this translation helpful? Give feedback.
-
thanks for your help as always K-Vanc, but for some reason it doesn't work for me. ["desc":"#(.?)#"||#replace#^(.{50}).||\1] and I tried ["desc":"#(.?)#"||#replace#^([\w\s\S]{50}).||\1] I even tried adding it in my existing line: And I tried to change 50 to 10 or whatever, so that I can see if there's any difference but nothing changes the length of the desc text block/the numbers of chars in desc. What am I doing wrong? |
Beta Was this translation helpful? Give feedback.
-
this works fine here...
but only if you copy/paste properly since one "*" is missing on your version....... don't use other line one atm. Noticed square bracket in replace may cause some parse error. I will fix it on next release... |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hey y'all!
First and foremost this is probably the best epg grabber for sure, I truly love it. Really really well done K-vanc!
Maybe some of you can help me though. I am working with Webgrab+ alongside Tempest and wrote myself a Perl script to replace the from numbers to star symbols ☆, and also adding them to the tag.
That worked quite well and then I looked at the EPGs in Tempest and I wanted to adapt the configs also to be able to use my script.
So far so good, and after reading through the superb manual dozens of times, I figured this should be possible without any script at all, just via the inverter path settings. But apparently I am too dumb for that :D
I hope someone can help me. Here's what I got:
["subtitle":"##episode# • #","##subtitle##"]["desc":"##country(,)##","# • #date##","# • #episode##","#\n#desc#..#","#\n-\nIMDb: #star-rating##"][“credits”:||#delete#]["writer":||#delete#]["producer":||#delete#]["composer":||#delete#]["actor":||#delete#]["director":||#delete#]["date":"#(.*?)#"]["category":"##category(,)##"||#max#2][“country”:||#delete#]["episode":"#(.*?)#"]["rating":||#delete#]
that's the main part of the inverter config. but then I tried the star-rating parts, quite different versions but nothing worked as I wanted it:
[“star-rating”:"##star-rating##"||#replace#(/5)||☆]
that's where I started but I read that I could shorten the code even so I went through various versions:
[“star-rating”:||#replace#(/5)$||]
[“star-rating”:||#replace#(\/5)||⭐]
[“star-rating”:||#replace#(\/5)$||⭐||#max#1]
["star-rating":"#(.*?)#"||#replace#(/5)||blubb]
right now I am debugging and using some different strings to replace in order to find it easily in the final epg "blubb".
Anyway, I hope someone can help me.... here is what it should look like when it's finished (the output is from Webgrab+ and my perl script):
Beta Was this translation helpful? Give feedback.
All reactions