Difference between revisions of "Custom Recording"
Steveadeff (talk | contribs) |
m (Fixes 'ss' resulting from Steve's broken keyboard) |
||
Line 3: | Line 3: | ||
= Getting Started = | = Getting Started = | ||
− | Go to Schedule Recordings->Custom Record. This page helps you build a database search one clause at a time. Each added clause further limits which showings will be matched in the TV listings. You can | + | Go to Schedule Recordings->Custom Record. This page helps you build a database search one clause at a time. Each added clause further limits which showings will be matched in the TV listings. You can test the search at any time and when you are done, you can save your search as a recording rule. |
= How It Works = | = How It Works = | ||
− | MythTV | + | MythTV stores TV program information in a database and uses the Structured Query Language (SQL) to access the data. Information about each TV program is stored in the 'program' table and information about each TV station you receive is stored in 'channel'. These two tables are used in the scheduler queries and their fields are available to be used in your rules. The rules you create are stored in 'record'. |
− | Normal rules in MythTV simply match the title in the rule with the titles in the 'program' table. MythTV also has search rules for "Titles", "Keywords" and "People". These | + | Normal rules in MythTV simply match the title in the rule with the titles in the 'program' table. MythTV also has search rules for "Titles", "Keywords" and "People". These store the key phrase in the description field of the rule and includes them in specialized SQL replacements for the normal title check. There is also a type called "Power Search" which takes the raw SQL in the description as the replacement for title matching. |
Custom Record is a tool to help you build valid SQL for Power Search rules. You do not need to be a SQL expert to use Custom Record because the examples are known to work correctly and are usually self-explanatory so you can choose the pieces you need then modify them. Many powerful solutions to unique problems are possible by combining the examples. With some creativity and some knowledge of SQL, the possibilities are limitless. | Custom Record is a tool to help you build valid SQL for Power Search rules. You do not need to be a SQL expert to use Custom Record because the examples are known to work correctly and are usually self-explanatory so you can choose the pieces you need then modify them. Many powerful solutions to unique problems are possible by combining the examples. With some creativity and some knowledge of SQL, the possibilities are limitless. | ||
Line 15: | Line 15: | ||
= Clauses = | = Clauses = | ||
− | Clauses have the basic form of "check field A for content B". They can also be "Check part C of field A for content B". ''Fields'' are the information categories in the database. ''Modifiers'' let you examine a specific part of a ''Field''. ''Logical Operators'' are how you | + | Clauses have the basic form of "check field A for content B". They can also be "Check part C of field A for content B". ''Fields'' are the information categories in the database. ''Modifiers'' let you examine a specific part of a ''Field''. ''Logical Operators'' are how you test a ''field'' for your criteria. |
== Fields == | == Fields == | ||
− | This is a | + | This is a list of valid fields and what information they hold. |
* program.chanid - The channel ID for the program. | * program.chanid - The channel ID for the program. | ||
− | * program. | + | * program.starttime - The start time of the program. |
* program.endtime - The end time of the program. | * program.endtime - The end time of the program. | ||
* program.title - The title of the program | * program.title - The title of the program | ||
Line 27: | Line 27: | ||
* program.description - | * program.description - | ||
* program.category - | * program.category - | ||
− | * program.category_type - Holds one of these exact four | + | * program.category_type - Holds one of these exact four strings: "movie", "series", "sports" or "tvshow". |
− | * program.airdate - is a | + | * program.airdate - is a string representing the year of release for movies and may have no meaning for other types of shows. |
− | * program. | + | * program.stars - is a floating point number from 0.0 to 1.0. On a four star scale, 1.0 would be four stars, 0.75 would be three stars and so on. |
* program.previouslyshown - Whether the show has been aired. | * program.previouslyshown - Whether the show has been aired. | ||
* program.title_pronounce - | * program.title_pronounce - | ||
− | * program. | + | * program.stereo - |
* program.subtitled - | * program.subtitled - | ||
* program.hdtv - | * program.hdtv - | ||
Line 39: | Line 39: | ||
* program.parttotal - | * program.parttotal - | ||
* program.seriesid - | * program.seriesid - | ||
− | * program.originalairdate - If provided, is the date when a show was, or will be, | + | * program.originalairdate - If provided, is the date when a show was, or will be, first televised. This may be useful for finding episodes before or after a certain date such as finding just the original series of "Battlestar Galactica". |
− | * program.previouslyshown - is a field created by MythTV to try to determine if a showing is more than 14 days after its original air date or if the show was marked as a repeat and did not have a date for the | + | * program.previouslyshown - is a field created by MythTV to try to determine if a showing is more than 14 days after its original air date or if the show was marked as a repeat and did not have a date for the first airing. If this is "0" it usually means that this is a brand new show or a rebroadcast within the first two weeks. |
* program.showtype - | * program.showtype - | ||
* program.colorcode - | * program.colorcode - | ||
* program.syndicatedepisodenumber - | * program.syndicatedepisodenumber - | ||
− | * program.programid - Is the Tribune Media Service database record identifier for each program description. In general, these | + | * program.programid - Is the Tribune Media Service database record identifier for each program description. In general, these start with a two letter prefix, MV, EP, SP or SH that correspond to the "program.category_type". For most, the last four digits are "0000" except EP where the last four digits are the episode number in the series. Note that these are generated by TMS and not the show's producers but they are usually in the same order as the original air dates for the episodes. Detailed information can be found in the Data Direct documentation at http://labs.zap2it.com/. |
* program. | * program. | ||
Line 59: | Line 59: | ||
* > - Greater than. | * > - Greater than. | ||
* = - Equal to. Can be combined with < or >. | * = - Equal to. Can be combined with < or >. | ||
− | * LIKE - Contains. Searches for your | + | * LIKE - Contains. Searches for your string within the ''field'' specified. |
= Useful Links = | = Useful Links = | ||
− | http://www.mythtv.org/docs/mythtv-HOWTO-12.html# | + | http://www.mythtv.org/docs/mythtv-HOWTO-12.html#s12.5 |
− | The Original How-To. | + | The Original How-To. Most of this information was taken from this. |
[[Category:HOWTO]] | [[Category:HOWTO]] |
Revision as of 22:56, 14 April 2006
Creating Power Search rules with Custom RecordMythTV's "Custom Record" feature gives you unlimited control for creatingspecialized search recording rules to meet your needs. It allows you tochoose your criteria to search for matching shows based on any of theinformation in the program listings, channel information, time functions andmore. This goes beyond the capabilities of any other DVR system and it isunlikely that this level of scheduling customization will ever be availablein any commercial DVR system.
Contents
Getting Started
Go to Schedule Recordings->Custom Record. This page helps you build a database search one clause at a time. Each added clause further limits which showings will be matched in the TV listings. You can test the search at any time and when you are done, you can save your search as a recording rule.
How It Works
MythTV stores TV program information in a database and uses the Structured Query Language (SQL) to access the data. Information about each TV program is stored in the 'program' table and information about each TV station you receive is stored in 'channel'. These two tables are used in the scheduler queries and their fields are available to be used in your rules. The rules you create are stored in 'record'.
Normal rules in MythTV simply match the title in the rule with the titles in the 'program' table. MythTV also has search rules for "Titles", "Keywords" and "People". These store the key phrase in the description field of the rule and includes them in specialized SQL replacements for the normal title check. There is also a type called "Power Search" which takes the raw SQL in the description as the replacement for title matching.
Custom Record is a tool to help you build valid SQL for Power Search rules. You do not need to be a SQL expert to use Custom Record because the examples are known to work correctly and are usually self-explanatory so you can choose the pieces you need then modify them. Many powerful solutions to unique problems are possible by combining the examples. With some creativity and some knowledge of SQL, the possibilities are limitless.
Clauses
Clauses have the basic form of "check field A for content B". They can also be "Check part C of field A for content B". Fields are the information categories in the database. Modifiers let you examine a specific part of a Field. Logical Operators are how you test a field for your criteria.
Fields
This is a list of valid fields and what information they hold.
- program.chanid - The channel ID for the program.
- program.starttime - The start time of the program.
- program.endtime - The end time of the program.
- program.title - The title of the program
- program.subtitle - The program subtitle, ie the episode name.
- program.description -
- program.category -
- program.category_type - Holds one of these exact four strings: "movie", "series", "sports" or "tvshow".
- program.airdate - is a string representing the year of release for movies and may have no meaning for other types of shows.
- program.stars - is a floating point number from 0.0 to 1.0. On a four star scale, 1.0 would be four stars, 0.75 would be three stars and so on.
- program.previouslyshown - Whether the show has been aired.
- program.title_pronounce -
- program.stereo -
- program.subtitled -
- program.hdtv -
- program.closecaptioned -
- program.partnumber -
- program.parttotal -
- program.seriesid -
- program.originalairdate - If provided, is the date when a show was, or will be, first televised. This may be useful for finding episodes before or after a certain date such as finding just the original series of "Battlestar Galactica".
- program.previouslyshown - is a field created by MythTV to try to determine if a showing is more than 14 days after its original air date or if the show was marked as a repeat and did not have a date for the first airing. If this is "0" it usually means that this is a brand new show or a rebroadcast within the first two weeks.
- program.showtype -
- program.colorcode -
- program.syndicatedepisodenumber -
- program.programid - Is the Tribune Media Service database record identifier for each program description. In general, these start with a two letter prefix, MV, EP, SP or SH that correspond to the "program.category_type". For most, the last four digits are "0000" except EP where the last four digits are the episode number in the series. Note that these are generated by TMS and not the show's producers but they are usually in the same order as the original air dates for the episodes. Detailed information can be found in the Data Direct documentation at http://labs.zap2it.com/.
- program.
Modifiers
- DAYNAME - Sunday, Monday, Tuesday, Wednesday, Thursday, Friday, Saturday
- HOUR - 0 to 24, "military time", 17 = 5PM
Logical Operators
- < - Less than.
- > - Greater than.
- = - Equal to. Can be combined with < or >.
- LIKE - Contains. Searches for your string within the field specified.
Useful Links
http://www.mythtv.org/docs/mythtv-HOWTO-12.html#s12.5 The Original How-To. Most of this information was taken from this.