NextPVR Forums
  • ______
  • Home
  • New Posts
  • Wiki
  • Members
  • Help
  • Search
  • Register
  • Login
  • Home
  • Wiki
  • Members
  • Help
  • Search
NextPVR Forums Public NextPVR Other Clients Old Stuff (legacy) NextPVR Enhanced Web Admin (NEWA) v
« Previous 1 … 11 12 13 14 15 … 47 Next »
Case sensitive search error

 
  • 0 Vote(s) - 0 Average
Case sensitive search error
mvallevand
Online

Posting Freak

Ontario Canada
Posts: 52,870
Threads: 954
Joined: May 2006
#1
2012-01-26, 06:51 AM
UJB, there seems to be a problem with Match Title/ Case Sensitive searching

I believe you need this logic near line 235 of SearchEngine.cs

Code:
//Check to see if we are matching the title
                    else if (matchTitle)
                    {
                        if (!caseSensitive)
                        {
                            where_cmd += " and UPPER(EPG_EVENT.title) = '" + searchFor + "'";
                        }
                        else
                        {
                            where_cmd += " and EPG_EVENT.title = '" + searchFor + "'";
                        }
                    }

Martin
UncleJohnsBand
Offline

Posting Freak

U.S.A.
Posts: 5,643
Threads: 258
Joined: Feb 2005
#2
2012-01-26, 11:29 PM
mvallevand Wrote:UJB, there seems to be a problem with Match Title/ Case Sensitive searching

I believe you need this logic near line 235 of SearchEngine.cs

Code:
//Check to see if we are matching the title
                    else if (matchTitle)
                    {
                        if (!caseSensitive)
                        {
                            where_cmd += " and UPPER(EPG_EVENT.title) = '" + searchFor + "'";
                        }
                        else
                        {
                            where_cmd += " and EPG_EVENT.title = '" + searchFor + "'";
                        }
                    }

Martin

Updated to the below....file on the FTP server....

Code:
if (!caseSensitive)
                    {
                        //Check to see if we are searching the start of the title
                        if (startTitle)
                        {
                            where_cmd += " and UPPER(EPG_EVENT.title) like '" + searchFor + "%'";
                        }
                            //Check to see if we are matching the title
                        else if (matchTitle)
                        {
                            where_cmd += " and UPPER(EPG_EVENT.title) = '" + searchFor + "'";
                        }
                        else
                            //we are searching the title
                        {
                            where_cmd += " and UPPER(EPG_EVENT.title) like '%" + searchFor + "%'";
                        }
                    }
                    else
                    {
                        //Check to see if we are searching the start of the title
                        if (startTitle)
                        {
                            where_cmd += " and EPG_EVENT.title like '" + searchFor + "%'";
                        }
                        //Check to see if we are matching the title
                        else if (matchTitle)
                        {
                            where_cmd += " and EPG_EVENT.title = '" + searchFor + "'";
                        }
                        else
                        //we are searching the title
                        {
                            where_cmd += " and EPG_EVENT.title like '%" + searchFor + "%'";
                        }
                    }
Intel Core i7 @ 4.00GHz Skylake 14nm
ASUSTeK COMPUTER INC. Z170-DELUXE
Windows 10 Pro x64
PVR Software: NPVR 5.1.1
SiliconDust HDHomeRun HDHR5-4US Connect Quatro 4 Channel Tuner
Roku Ultra
2 PCH A-100's
mvallevand
Online

Posting Freak

Ontario Canada
Posts: 52,870
Threads: 954
Joined: May 2006
#3
2012-01-26, 11:45 PM
Thanks, I'll check it in an hour or so. ASCII "like" searches are case insensitive anyway, which is why I skipped that big change, but it is probably more future-proof. l Since this can mess with auto-recordings it might be worth adding the file here.

Martin
UncleJohnsBand
Offline

Posting Freak

U.S.A.
Posts: 5,643
Threads: 258
Joined: Feb 2005
#4
2012-01-27, 02:42 AM
mvallevand Wrote:Thanks, I'll check it in an hour or so. ASCII "like" searches are case insensitive anyway, which is why I skipped that big change, but it is probably more future-proof. l Since this can mess with auto-recordings it might be worth adding the file here.

Martin

Just dropped another one out there.....the same check needed to be added to subtitle and description......the one on the FTP server now has those areas as well.

Thanks for finding this.
Intel Core i7 @ 4.00GHz Skylake 14nm
ASUSTeK COMPUTER INC. Z170-DELUXE
Windows 10 Pro x64
PVR Software: NPVR 5.1.1
SiliconDust HDHomeRun HDHR5-4US Connect Quatro 4 Channel Tuner
Roku Ultra
2 PCH A-100's
mvallevand
Online

Posting Freak

Ontario Canada
Posts: 52,870
Threads: 954
Joined: May 2006
#5
2012-01-27, 02:11 PM
UJB, I have taken the liberty of uploading your file here since it is required to run NEWA queries in SearchLite.

To install it backup the file [NPVR Data]\web\App_Code\Classes\SearchEngine.cs and replace with the attached.

Martin
mvallevand
Online

Posting Freak

Ontario Canada
Posts: 52,870
Threads: 954
Joined: May 2006
#6
2012-02-13, 12:50 PM
UJB, I ran into another logic issue with Exact search matching. You escape the search string to deal with apostrophe's in the string for sqlite but then use it escaped for a check that will fail

Code:
searchFor = HttpUtility.UrlDecode(searchFor).Replace("'", "''");
...
                                if (pgm.Title.IndexOf(searchFor) > -1)
                                {
...

It does work if you unescape it with .Replace("''","'") but I am not sure if that is how you will want to do this.

Martin
UncleJohnsBand
Offline

Posting Freak

U.S.A.
Posts: 5,643
Threads: 258
Joined: Feb 2005
#7
2012-02-13, 11:22 PM
mvallevand Wrote:UJB, I ran into another logic issue with Exact search matching. You escape the search string to deal with apostrophe's in the string for sqlite but then use it escaped for a check that will fail

Code:
searchFor = HttpUtility.UrlDecode(searchFor).Replace("'", "''");
...
                                if (pgm.Title.IndexOf(searchFor) > -1)
                                {
...

It does work if you unescape it with .Replace("''","'") but I am not sure if that is how you will want to do this.

Martin

Thanks.....attached is the patch.....the issue existed at title, subtitle and description. Also found code preventing genre matching from working because it was still within a loop specific to users with schedulesdirect utilities.....this cleans all of these items up.
Intel Core i7 @ 4.00GHz Skylake 14nm
ASUSTeK COMPUTER INC. Z170-DELUXE
Windows 10 Pro x64
PVR Software: NPVR 5.1.1
SiliconDust HDHomeRun HDHR5-4US Connect Quatro 4 Channel Tuner
Roku Ultra
2 PCH A-100's
mvallevand
Online

Posting Freak

Ontario Canada
Posts: 52,870
Threads: 954
Joined: May 2006
#8
2012-02-14, 12:55 AM
Thanks UJB that works fine. Although right now I use my own genre logic, are there genre capabilities available via web service?

Martin
UncleJohnsBand
Offline

Posting Freak

U.S.A.
Posts: 5,643
Threads: 258
Joined: Feb 2005
#9
2012-02-16, 02:57 AM
mvallevand Wrote:Thanks UJB that works fine. Although right now I use my own genre logic, are there genre capabilities available via web service?

Martin

Yes....the web service search object supports genre.
Intel Core i7 @ 4.00GHz Skylake 14nm
ASUSTeK COMPUTER INC. Z170-DELUXE
Windows 10 Pro x64
PVR Software: NPVR 5.1.1
SiliconDust HDHomeRun HDHR5-4US Connect Quatro 4 Channel Tuner
Roku Ultra
2 PCH A-100's
« Next Oldest | Next Newest »

Users browsing this thread: 1 Guest(s)



Possibly Related Threads…
Thread Author Replies Views Last Post
  Error with Web Admin? jksmurf 0 2,329 2019-06-20, 10:34 AM
Last Post: jksmurf
  Episode search missing in 4.2.4 UncT 4 3,097 2019-03-08, 06:08 PM
Last Post: UncT
  NEWA Auto-Search Command Line Interface (CLI) UncleJohnsBand 40 37,576 2018-05-09, 12:50 AM
Last Post: jksmurf
  Server Error in '/' Application smajor 19 16,846 2017-10-27, 12:57 PM
Last Post: mvallevand
  Error when trying to stream from NEWA on PC jksmurf 2 2,793 2017-02-27, 05:12 AM
Last Post: jksmurf
  Server Error in '/' Application [streaming failure] oldman 3 3,039 2017-02-04, 12:48 AM
Last Post: UncleJohnsBand
  Server Error when settign a manual recording in NEWA martinu 2 2,333 2017-01-23, 01:30 AM
Last Post: UncleJohnsBand
  Internal Server Error SilverTiger 5 3,193 2016-07-24, 04:03 PM
Last Post: UncleJohnsBand
  "Record selected" returns error web page ... softfoot 5 3,742 2016-03-26, 01:37 PM
Last Post: UncleJohnsBand
  Server Error in "/" Application ? Lone_Stranger 1 2,406 2016-02-19, 02:10 AM
Last Post: UncleJohnsBand

  • View a Printable Version
  • Subscribe to this thread
Forum Jump:

© Designed by D&D, modified by NextPVR - Powered by MyBB

Linear Mode
Threaded Mode