NextPVR Forums

Full Version: NEWA Web Server with AdvancedRules
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
UJB, further to this post http://forums.nextpvr.com/showthread.php...post407635 web services doesn't appear to like titles with quotes because of this code.

string rules = "title like '" + programme.Title + "%'";

Should I escape titles beforehand and if so which call use AdvancedRules?

Martin
Not sure if channing that line to be + programme.Title.Replace("'","''") + would fix the problem or not(changing single quotes found in the title to double single quotes....do you want to give it a go? I am sure there is a valid replace that can be done for this....just not sure which it is and what SQLite will like as the result and still provide expected results. Something sticks in my head that I may have looked at this before.....but I am in a slight fog now recovering from the cold from hell.
It works, I made a post that I deleted that you can might stiill see, and you can undelete now. I was going to repost because I think my solution probably should be with a local string but forgot.

I also have concerns about the use of the trialing % for this query too. If V returns next year you could end up with every show beginning with V on every channel and any time.

Martin
mvallevand Wrote:It works, I made a post that I deleted that you can might stiill see, and you can undelete now. I was going to repost because I think my solution probably should be with a local string but forgot.

I also have concerns about the use of the trialing % for this query too. If V returns next year you could end up with every show beginning with V on every channel and any time.

Martin

I added the single to double single quote conversion when a recurring recording is being created....

I am not sure why I used the % at the end of the title when building the rule.....I am thinking becase I used the Like verb. Do you think it should be string rules = "title equals '" + programme.Title + '"; instead of string rules = "title like '" + programme.Title + "%'"; ?? (of course single quoates in the value of programme.title will now be double quotes)
I think this query should be exact. Could you imagine a rule for short title like V that would record every show beginning with V at any time on any channel. In SearchLite I am setting these from EPG data anyway and I guess I could always send exact matches for this query.

Martin