Permalink
Browse files

Add Support for Season, Episode, and Inetref values to recordings.

This commit constitutes the "scary part," namely the deep dark changes to the many database queries dealing with program data, the serialization of that program data on the protocol, the scheduler, and the various types of bindings.

More succinctly put, this commit does nothing but set the stage for the UI and support application portions that are coming.  Once those parts are committed, you will be able to perform a metadata query on a recording rule as you set it up, set its inetref, and forevermore have it perform supplemental metadata lookups to add this data and more to your recordings.  Completed and properly configured recordings will have season and episode information, as well as statically associated artwork.  The fanart, banner, and coverart for a recording will be browsed for and set according to your preference, rather than being "best effort" or "luck of the draw."  You will be able to use these values in user jobs to name transcoded files in a more conventional way.  Theoretically the PlaybackBox could be expanded to show a season/episode hierarchy.  The possibilities go on and on.

In several days of testing, this appears to be stable and operating as expected, including some uncommitted UI portions.  This *is* a hugely invasive change that touches the order of ProgramInfo data via the protocol (renumbering it), and lots of other things.  Mythweb and all the bindings appear to be working.  Scheduling and both live and recordings are working.

Technically speaking the UI portions of this allowing one to export season and episode numbers and display them wherever programinfo is used are present and working-- they're just not populated with anything of value yet.
  • Loading branch information...
1 parent 369ee54 commit a41e9657c0e9dfbfb4127344fd6f984039dba10e Robert McNamara committed Jul 3, 2011
@@ -8,7 +8,7 @@
#
# Version
- $VERSION = '.24svn';
+ $VERSION = '.25svn';
# Load sub libraries
use IO::Socket::INET::MythTV;
@@ -106,20 +106,20 @@ package MythTV;
# Note: as of July 21, 2010, this is actually a string, to account for proto
# versions of the form "58a". This will get used if protocol versions are
# changed on a fixes branch ongoing.
- our $PROTO_VERSION = "66";
- our $PROTO_TOKEN = "0C0FFEE0";
+ our $PROTO_VERSION = "67";
+ our $PROTO_TOKEN = "0G0G0G0";
# currentDatabaseVersion is defined in libmythtv in
# mythtv/libs/libmythtv/dbcheck.cpp and should be the current MythTV core
# schema version supported in the main code. We need to check that the schema
# version in the database is as expected by the bindings, which are expected
# to be kept in sync with the main code.
- our $SCHEMA_VERSION = "1277";
+ our $SCHEMA_VERSION = "1278";
# NUMPROGRAMLINES is defined in mythtv/libs/libmythtv/programinfo.h and is
# the number of items in a ProgramInfo QStringList group used by
# ProgramInfo::ToSringList and ProgramInfo::FromStringList.
- our $NUMPROGRAMLINES = 41;
+ our $NUMPROGRAMLINES = 44;
# Reasons a recording wouldn't be happening (from libs/libmythtv/programinfo.h)
our %RecStatus_Types = (
@@ -43,48 +43,51 @@ package MythTV::Program;
$self->{'title'} = $_[0]; # 00 title
$self->{'subtitle'} = $_[1]; # 01 subtitle
$self->{'description'} = $_[2]; # 02 description
- $self->{'category'} = $_[3]; # 03 category
- $self->{'chanid'} = $_[4]; # 04 chanid
- $self->{'channum'} = $_[5]; # 05 chanstr
- $self->{'callsign'} = $_[6]; # 06 chansign
- $self->{'channame'} = $_[7]; # 07 channame
- $self->{'filename'} = $_[8]; # 08 pathname
- $self->{'filesize'} = $_[9]; # 09 filesize
+ $self->{'season'} = $_[3]; # 03 season
+ $self->{'episode'} = $_[4]; # 04 episode
+ $self->{'category'} = $_[5]; # 05 category
+ $self->{'chanid'} = $_[6]; # 06 chanid
+ $self->{'channum'} = $_[7]; # 07 chanstr
+ $self->{'callsign'} = $_[8]; # 08 chansign
+ $self->{'channame'} = $_[9]; # 09 channame
+ $self->{'filename'} = $_[10]; # 10 pathname
+ $self->{'filesize'} = $_[11]; # 11 filesize
- $self->{'starttime'} = $_[10]; # 10 startts Scheduled starttime (unix timestamp)
- $self->{'endtime'} = $_[11]; # 11 endts Scheduled endtime (unix timestamp)
- $self->{'findid'} = $_[12]; # 12 findid
- $self->{'hostname'} = $_[13]; # 13 hostname
- $self->{'sourceid'} = $_[14]; # 14 sourceid
- $self->{'cardid'} = $_[15]; # 15 cardid
- $self->{'inputid'} = $_[16]; # 16 inputid
- $self->{'recpriority'} = $_[17]; # 17 recpriority
- $self->{'recstatus'} = $_[18]; # 18 recstatus
- $self->{'recordid'} = $_[19]; # 19 recordid
+ $self->{'starttime'} = $_[12]; # 12 startts Scheduled starttime (unix timestamp)
+ $self->{'endtime'} = $_[13]; # 13 endts Scheduled endtime (unix timestamp)
+ $self->{'findid'} = $_[14]; # 14 findid
+ $self->{'hostname'} = $_[15]; # 15 hostname
+ $self->{'sourceid'} = $_[16]; # 16 sourceid
+ $self->{'cardid'} = $_[17]; # 17 cardid
+ $self->{'inputid'} = $_[18]; # 18 inputid
+ $self->{'recpriority'} = $_[19]; # 19 recpriority
+ $self->{'recstatus'} = $_[20]; # 20 recstatus
+ $self->{'recordid'} = $_[21]; # 21 recordid
- $self->{'rectype'} = $_[20]; # 20 rectype
- $self->{'dupin'} = $_[21]; # 21 dupin
- $self->{'dupmethod'} = $_[22]; # 22 dupmethod
- $self->{'recstartts'} = $_[23]; # 23 recstartts ACTUAL start time (unix timestamp)
- $self->{'recendts'} = $_[24]; # 24 recendts ACTUAL end time (unix timestamp)
- $self->{'progflags'} = $_[25]; # 25 programflags
- $self->{'recgroup'} = $_[26]; # 26 recgroup
- $self->{'outputfilters'} = $_[27]; # 27 chanOutputFilters
- $self->{'seriesid'} = $_[28]; # 28 seriesid
- $self->{'programid'} = $_[29]; # 29 programid
+ $self->{'rectype'} = $_[22]; # 22 rectype
+ $self->{'dupin'} = $_[23]; # 23 dupin
+ $self->{'dupmethod'} = $_[24]; # 24 dupmethod
+ $self->{'recstartts'} = $_[25]; # 25 recstartts ACTUAL start time (unix timestamp)
+ $self->{'recendts'} = $_[26]; # 26 recendts ACTUAL end time (unix timestamp)
+ $self->{'progflags'} = $_[27]; # 27 programflags
+ $self->{'recgroup'} = $_[28]; # 28 recgroup
+ $self->{'outputfilters'} = $_[29]; # 29 chanOutputFilters
+ $self->{'seriesid'} = $_[30]; # 30 seriesid
+ $self->{'programid'} = $_[31]; # 31 programid
+ $self->{'inetref'} = $_[32]; # 32 inetref
- $self->{'lastmodified'} = $_[30]; # 30 lastmodified
- $self->{'stars'} = $_[31]; # 31 stars
- $self->{'airdate'} = $_[32]; # 32 originalAirDate (ISO 8601 format)
- $self->{'playgroup'} = $_[33]; # 33 playgroup
- $self->{'recpriority2'} = $_[34]; # 34 recpriority2
- $self->{'parentid'} = $_[35]; # 35 parentid
- $self->{'storagegroup'} = $_[36]; # 36 storagegroup
- $self->{'audio_props'} = $_[37]; # 37 Audio properties
- $self->{'video_props'} = $_[38]; # 38 Video properties
- $self->{'subtitle_type'} = $_[39]; # 39 Subtitle type
+ $self->{'lastmodified'} = $_[33]; # 33 lastmodified
+ $self->{'stars'} = $_[34]; # 34 stars
+ $self->{'airdate'} = $_[35]; # 35 originalAirDate (ISO 8601 format)
+ $self->{'playgroup'} = $_[36]; # 36 playgroup
+ $self->{'recpriority2'} = $_[37]; # 37 recpriority2
+ $self->{'parentid'} = $_[38]; # 38 parentid
+ $self->{'storagegroup'} = $_[39]; # 39 storagegroup
+ $self->{'audio_props'} = $_[40]; # 40 Audio properties
+ $self->{'video_props'} = $_[41]; # 41 Video properties
+ $self->{'subtitle_type'} = $_[42]; # 42 Subtitle type
- $self->{'year'} = $_[40]; # 40 Production year
+ $self->{'year'} = $_[43]; # 43 Production year
# Load the channel data
if ($self->{'chanid'}) {
@@ -134,48 +137,51 @@ package MythTV::Program;
$self->{'title'} , # 00 title
$self->{'subtitle'} , # 01 subtitle
$self->{'description'} , # 02 description
- $self->{'category'} , # 03 category
- $self->{'chanid'} , # 04 chanid
- $self->{'channum'} , # 05 chanstr
- $self->{'callsign'} , # 06 chansign
- $self->{'channame'} , # 07 channame
- $self->{'filename'} , # 08 pathname
- $self->{'filesize'} , # 09 filesize
+ $self->{'season'} , # 03 season
+ $self->{'episode'} , # 04 episode
+ $self->{'category'} , # 05 category
+ $self->{'chanid'} , # 06 chanid
+ $self->{'channum'} , # 07 chanstr
+ $self->{'callsign'} , # 08 chansign
+ $self->{'channame'} , # 09 channame
+ $self->{'filename'} , # 10 pathname
+ $self->{'filesize'} , # 11 filesize
- $self->{'starttime'} , # 10 startts
- $self->{'endtime'} , # 11 endts
- $self->{'findid'} , # 12 findid
- $self->{'hostname'} , # 13 hostname
- $self->{'sourceid'} , # 14 sourceid
- $self->{'cardid'} , # 15 cardid
- $self->{'inputid'} , # 16 inputid
- $self->{'recpriority'} , # 17 recpriority
- $self->{'recstatus'} , # 18 recstatus
- $self->{'recordid'} , # 19 recordid
+ $self->{'starttime'} , # 12 startts
+ $self->{'endtime'} , # 13 endts
+ $self->{'findid'} , # 14 findid
+ $self->{'hostname'} , # 15 hostname
+ $self->{'sourceid'} , # 16 sourceid
+ $self->{'cardid'} , # 17 cardid
+ $self->{'inputid'} , # 18 inputid
+ $self->{'recpriority'} , # 19 recpriority
+ $self->{'recstatus'} , # 20 recstatus
+ $self->{'recordid'} , # 21 recordid
- $self->{'rectype'} , # 20 rectype
- $self->{'dupin'} , # 21 dupin
- $self->{'dupmethod'} , # 22 dupmethod
- $self->{'recstartts'} , # 23 recstartts
- $self->{'recendts'} , # 24 recendts
- $self->{'progflags'} , # 25 programflags
- $self->{'recgroup'} , # 26 recgroup
- $self->{'outputfilters'} , # 27 chanOutputFilters
- $self->{'seriesid'} , # 28 seriesid
- $self->{'programid'} , # 29 programid
+ $self->{'rectype'} , # 22 rectype
+ $self->{'dupin'} , # 23 dupin
+ $self->{'dupmethod'} , # 24 dupmethod
+ $self->{'recstartts'} , # 25 recstartts
+ $self->{'recendts'} , # 26 recendts
+ $self->{'progflags'} , # 27 programflags
+ $self->{'recgroup'} , # 28 recgroup
+ $self->{'outputfilters'} , # 29 chanOutputFilters
+ $self->{'seriesid'} , # 30 seriesid
+ $self->{'programid'} , # 31 programid
+ $self->{'inetref'} , # 32 inetref
- $self->{'lastmodified'} , # 30 lastmodified
- $self->{'stars'} , # 31 stars
- $self->{'airdate'} , # 32 originalAirDate
- $self->{'playgroup'} , # 33 playgroup
- $self->{'recpriority2'} , # 34 recpriority2
- $self->{'parentid'} , # 35 parentid
- $self->{'storagegroup'} , # 36 storagegroup
- $self->{'audio_props'} , # 37 audio properties
- $self->{'video_props'} , # 38 video properties
- $self->{'subtitle_type'} , # 39 subtitle type
+ $self->{'lastmodified'} , # 33 lastmodified
+ $self->{'stars'} , # 34 stars
+ $self->{'airdate'} , # 35 originalAirDate
+ $self->{'playgroup'} , # 36 playgroup
+ $self->{'recpriority2'} , # 37 recpriority2
+ $self->{'parentid'} , # 38 parentid
+ $self->{'storagegroup'} , # 39 storagegroup
+ $self->{'audio_props'} , # 40 audio properties
+ $self->{'video_props'} , # 41 video properties
+ $self->{'subtitle_type'} , # 42 subtitle type
- $self->{'year'} , # 40 production year
+ $self->{'year'} , # 43 production year
'' # trailing separator
);
}
@@ -11,16 +11,16 @@ class MythBackend {
// MYTH_PROTO_VERSION is defined in libmyth in mythtv/libs/libmyth/mythcontext.h
// and should be the current MythTV protocol version.
- static $protocol_version = '66';
- static $protocol_token = '0C0FFEE0';
+ static $protocol_version = '67';
+ static $protocol_token = '0G0G0G0';
// The character string used by the backend to separate records
static $backend_separator = '[]:[]';
// NUMPROGRAMLINES is defined in mythtv/libs/libmythtv/programinfo.h and is
// the number of items in a ProgramInfo QStringList group used by
// ProgramInfo::ToSringList and ProgramInfo::FromStringList.
- static $program_line_number = 41;
+ static $program_line_number = 44;
private $fp = null;
private $connected = false;
@@ -8,6 +8,8 @@ class MythTVProgram {
public $title = 'Untitled';
public $subtitle = 'Untitled';
public $description = 'No Description';
+ public $season;
+ public $episode;
public $category;
public $chanid;
public $channum;
@@ -35,6 +37,7 @@ class MythTVProgram {
public $outputfilters;
public $seriesid;
public $programid;
+ public $inetref;
public $lastmodified;
public $stars;
public $airdate;
@@ -9,6 +9,8 @@ class MythTVRecording {
public $title;
public $subtitle;
public $description;
+ public $season;
+ public $episode;
public $category;
public $hostname;
public $bookmark;
@@ -20,6 +22,7 @@ class MythTVRecording {
public $recordid;
public $seriesid;
public $programid;
+ public $inetref;
public $lastmodified;
public $filesize;
public $stars;
@@ -773,28 +773,30 @@ class Program( DictData, RECSTATUS, AUDIO_PROPS, VIDEO_PROPS, \
"""Represents a program with all detail returned by the backend."""
_field_order = [ 'title', 'subtitle', 'description',
- 'category', 'chanid', 'channum',
- 'callsign', 'channame', 'filename',
- 'filesize', 'starttime', 'endtime',
- 'findid', 'hostname', 'sourceid',
- 'cardid', 'inputid', 'recpriority',
- 'recstatus', 'recordid', 'rectype',
- 'dupin', 'dupmethod', 'recstartts',
- 'recendts', 'programflags', 'recgroup',
- 'outputfilters','seriesid', 'programid',
+ 'season', 'episode', 'category',
+ 'chanid', 'channum', 'callsign',
+ 'channame', 'filename', 'filesize',
+ 'starttime', 'endtime', 'findid',
+ 'hostname', 'sourceid', 'cardid',
+ 'inputid', 'recpriority', 'recstatus',
+ 'recordid', 'rectype', 'dupin',
+ 'dupmethod', 'recstartts', 'recendts',
+ 'programflags', 'recgroup', 'outputfilters',
+ 'seriesid', 'programid', 'inetref',
'lastmodified', 'stars', 'airdate',
'playgroup', 'recpriority2', 'parentid',
'storagegroup', 'audio_props', 'video_props',
'subtitle_type','year']
_field_type = [ 3, 3, 3,
- 3, 0, 3,
- 3, 3, 3,
- 0, 4, 4,
- 0, 3, 0,
- 0, 0, 0,
0, 0, 3,
- 0, 0, 4,
- 4, 3, 3,
+ 0, 3, 3,
+ 3, 3, 0,
+ 4, 4, 0,
+ 3, 0, 0,
+ 0, 0, 0,
+ 0, 3, 0,
+ 0, 4, 4,
+ 3, 3, 3,
3, 3, 3,
4, 1, 5,
3, 0, 3,
@@ -5,11 +5,11 @@
"""
OWN_VERSION = (0,25,-1,2)
-SCHEMA_VERSION = 1277
+SCHEMA_VERSION = 1278
NVSCHEMA_VERSION = 1007
MUSICSCHEMA_VERSION = 1018
-PROTO_VERSION = '66'
-PROTO_TOKEN = '0C0FFEE0'
+PROTO_VERSION = '67'
+PROTO_TOKEN = '0G0G0G0'
BACKEND_SEP = '[]:[]'
INSTALL_PREFIX = '/usr/local'
Oops, something went wrong.

0 comments on commit a41e965

Please sign in to comment.