NextPVR Forums
  • ______
  • Home
  • New Posts
  • Wiki
  • Members
  • Help
  • Search
  • Register
  • Login
  • Home
  • Wiki
  • Members
  • Help
  • Search
NextPVR Forums Public Developers v
« Previous 1 … 84 85 86 87 88 … 93 Next »
Search for Episodes by Keyword

 
  • 0 Vote(s) - 0 Average
Search for Episodes by Keyword
KingArgyle
Offline

Posting Freak

Posts: 1,271
Threads: 95
Joined: Nov 2004
#1
2004-11-14, 11:37 PM
Here is some C# source code for searching for an Episode by Keyword. This only checks the title, and the function can be modified for anybody's use. Since I wanted to learn C# (amazing how much like Java it is. Wink ) and GBPVR was missing a more robust search method to find episodes, I figured I'd give this a whirl. Took about a half hour to get working, but this will take a keyword, and search all channels from the current date and time to an ending date 30 days out. It'll return all episodes that have that keyword in the title. I believe Jorm is planning on implementing something like this for the UI, I may try and get this implemented for the Web Interface as well. I don't plan to use the UI too much, just the recording engine.

Anyway, here is the function, feel free to modify it and use it as you wish in your own plugins.

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">
private static void SearchForEpisodeByTitle() {
ScheduleHelper scheduleHelper = ScheduleHelper.getInstance();
// Search for an episode listing, set the start time and the end time
DateTime startTime = DateTime.Now;
DateTime endTime = startTime.AddDays((double) 30);
String searchFor = "Apprentice";

IList allChannels = scheduleHelper.GetListingsForTimePeriod(startTime, endTime);
foreach (Channel channel in allChannels) {
foreach (Programme program in channel.getProgrammeList()) {
String findString = program.getTitle().ToUpper();

if (findString.IndexOf(searchFor.ToUpper(), 0) >= 0) {
Console.WriteLine("Found: " + searchFor);
Console.WriteLine("Title: " + program.getTitle());
Console.WriteLine("Channel: " + channel.channelName);
Console.WriteLine("Start Time: " + program.getStartTime().ToLongDateString() + " " + program.getStartTime().ToLongTimeString());
Console.WriteLine("End Time: " + program.getEndTime().ToLongDateString() + " " + program.getStartTime().ToLongTimeString());
}
}
}
}
[/QUOTE]
« Next Oldest | Next Newest »

Users browsing this thread: 1 Guest(s)



Possibly Related Threads…
Thread Author Replies Views Last Post
  Roku channel for NPVR with Search & Schedule ioan 12 11,685 2013-03-31, 01:34 AM
Last Post: btpoole
  Multiple lists like in Search Screen cncb 7 3,256 2012-08-08, 09:11 PM
Last Post: cncb
  Netflix Search and Viewer dhgb256 153 43,570 2009-11-10, 11:35 PM
Last Post: Snooze
  Google Code Search Graham 1 1,316 2007-03-29, 05:34 PM
Last Post: McBainUK
  Any xmltv users willing to test some new search features? Jim_ 14 4,368 2006-10-11, 07:40 PM
Last Post: Jim_
  Search Confg.xml Ron22 5 2,422 2005-05-11, 03:23 AM
Last Post: Ron22
  Sql search programming question jorm 2 1,739 2004-11-18, 06:11 PM
Last Post: jorm
  In search of aegisx 9 3,376 2004-11-10, 07:21 PM
Last Post: jorm
  Search Plugin aegisx 2 2,122 2004-10-11, 07:28 PM
Last Post: aegisx

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

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

Linear Mode
Threaded Mode