Linux-DVB-DVBT-Apps-QuartzPVR
view release on metacpan - search on metacpan
view release on metacpan or search on metacpan
Makefile.PL view on Meta::CPAN
{
$vars_list .= "$var " ;
}
$settings_href->{'_VARS_LIST_'} = $vars_list ;
}
#----------------------------------------------------------------------
sub update_install_script
{
my ($tpl_install_script, $install_script, $settings_href) = @_ ;
## Read in file
my @lines ;
{
local( $/ ) ;
open( my $fh, $tpl_install_script ) or die "Error: reading install script file $tpl_install_script : $!" ;
my $lines = <$fh> ;
close $fh ;
install/tpl/quartzpvr-install.pl view on Meta::CPAN
$sql = $app->data("sql") . $app->data("versions.sql") ;
$sql =~ s/\%DATABASE\%/$settings_href->{'DATABASE'}/g ;
mysql_runit($app, $password, $sql, "MySQL error while creating tables") ;
}
update_table_versions($app, $settings_href, \%table_versions)
}
#----------------------------------------------------------------------
sub update_table_versions
{
my ($app, $settings_href, $latest_versions_href) = @_ ;
my $table = 'versions' ;
my $sql = "" ;
foreach my $item (keys %$latest_versions_href)
{
$sql .= "UPDATE $settings_href->{DATABASE}.$table SET `version`='$latest_versions_href->{$item}' where `item` = '$item';\n" ;
}
my $password = $settings_href->{'SQL_ROOT_PASSWORD'} ;
mysql_runit($app, $password, $sql, "MySQL error while updating table '$table' to set latest versions") ;
}
#----------------------------------------------------------------------
sub update_table_channels
{
my ($app, $settings_href, $existing_version, $latest_version) = @_ ;
my $table = 'channels' ;
if ($existing_version lt '1.01')
{
my $password = $settings_href->{'SQL_ROOT_PASSWORD'} ;
my $sql =<<SQL ;
ALTER TABLE $settings_href->{DATABASE}.$table CHANGE `chan_type` `chan_type` set('tv','radio','hd-tv') NOT NULL DEFAULT 'tv' COMMENT 'TV or Radio' ;
SQL
mysql_runit($app, $password, $sql, "MySQL error while updating table '$table' to version $latest_version") ;
}
}
#----------------------------------------------------------------------
sub update_table_iplay
{
my ($app, $settings_href, $existing_version, $latest_version) = @_ ;
# no op
}
#----------------------------------------------------------------------
sub update_table_listings
{
my ($app, $settings_href, $existing_version, $latest_version) = @_ ;
# no op
}
#----------------------------------------------------------------------
sub update_table_multirec
{
my ($app, $settings_href, $existing_version, $latest_version) = @_ ;
my $table = 'multirec' ;
if ($existing_version eq '0')
{
my $password = $settings_href->{'SQL_ROOT_PASSWORD'} ;
my $sql =<<SQL ;
ALTER TABLE $settings_href->{DATABASE}.$table CHANGE `adapter` `adapter` VARCHAR( 16 ) NOT NULL DEFAULT '0' ;
SQL
mysql_runit($app, $password, $sql, "MySQL error while updating table '$table' to version $latest_version") ;
}
}
#----------------------------------------------------------------------
sub update_table_record
{
my ($app, $settings_href, $existing_version, $latest_version) = @_ ;
my $table = 'record' ;
if ($existing_version eq '0')
{
my $password = $settings_href->{'SQL_ROOT_PASSWORD'} ;
my $sql =<<SQL ;
ALTER TABLE $settings_href->{DATABASE}.$table DROP `episode`, DROP `num_episodes`, DROP `adapter` ;
SQL
mysql_try_runit($app, $password, $sql) ;
}
}
#----------------------------------------------------------------------
sub update_table_recorded
{
my ($app, $settings_href, $existing_version, $latest_version) = @_ ;
my $table = 'recorded' ;
if ($existing_version eq '0')
{
my $password = $settings_href->{'SQL_ROOT_PASSWORD'} ;
my $sql =<<SQL ;
ALTER TABLE $settings_href->{DATABASE}.$table CHANGE `adapter` `adapter` VARCHAR( 16 ) NOT NULL DEFAULT '0' ;
SQL
mysql_runit($app, $password, $sql, "MySQL error while updating table '$table' to version $latest_version") ;
}
}
#----------------------------------------------------------------------
sub update_table_schedule
{
my ($app, $settings_href, $existing_version, $latest_version) = @_ ;
my $table = 'schedule' ;
if ($existing_version eq '0')
{
my $password = $settings_href->{'SQL_ROOT_PASSWORD'} ;
my $sql =<<SQL ;
ALTER TABLE $settings_href->{DATABASE}.$table CHANGE `adapter` `adapter` VARCHAR( 16 ) NOT NULL DEFAULT '0' ;
SQL
lib/Linux/DVB/DVBT/Apps/QuartzPVR.pm view on Meta::CPAN
## Do the update
$this->update() ;
}
}
#--------------------------------------------------------------------------------------------
# Gathers all the latest information from the EPG database and the recordings database and re-schedules
sub update
{
my $this = shift ;
Linux::DVB::DVBT::Apps::QuartzPVR::Base::DbgProf::startfn() ;
Linux::DVB::DVBT::Apps::QuartzPVR::Base::DbgTrace::trace_clear() ;
print "Linux::DVB::DVBT::Apps::QuartzPVR::update() : ".$this->date."\n" if $this->debug ;
my $tvrec = $this->_tvrec ;
my $tvreport = $this->_tvreport ;
lib/Linux/DVB/DVBT/Apps/QuartzPVR/Crontab.pm view on Meta::CPAN
print "\n\nIPLAY Blocks:\n" ;
foreach my $block (@record_blocks)
{
print "\n------------\n", $block->dump ;
}
}
#---------------------------------------------------------------------
# Update crontab to match database
sub update
{
my ($recording_aref) = @_ ;
## get existing blocks
my @record_blocks = get_blocks($opts_href->{'crontag'}) ;
## Remove existing blocks
$ct->remove(@record_blocks) ;
## Create new blocks
create_blocks($recording_aref) ;
}
#---------------------------------------------------------------------
# Update crontab to match database
sub update_iplay
{
my ($recording_aref) = @_ ;
## get existing blocks
my @record_blocks = get_blocks($opts_href->{'crontag_iplay'}) ;
## Remove existing blocks
$ct->remove(@record_blocks) ;
## Create new blocks
lib/Linux/DVB/DVBT/Apps/QuartzPVR/Iplayer.pm view on Meta::CPAN
Linux::DVB::DVBT::Apps::QuartzPVR::Base::DbgProf::endfn() ;
return $entry_href ;
}
#---------------------------------------------------------------------
# Update cron jobs
#
sub update_cron
{
my $this = shift ;
my ($schedule_aref) = @_ ;
Linux::DVB::DVBT::Apps::QuartzPVR::Base::DbgTrace::startfn('update cron') ;
Linux::DVB::DVBT::Apps::QuartzPVR::Base::DbgProf::startfn() ;
## Set cron
Linux::DVB::DVBT::Apps::QuartzPVR::Crontab::update_iplay($schedule_aref) ;
lib/Linux/DVB/DVBT/Apps/QuartzPVR/Sql.pm view on Meta::CPAN
print " + rid=$rid\n" if $this->debug ;
Linux::DVB::DVBT::Apps::QuartzPVR::Base::DbgTrace::add_rec($rec_href, "inserted - new rid $rid") ;
$this->sql->debug(0) ;
return $rid ;
}
#---------------------------------------------------------------------------------------------------
# Update recording
sub update_recording
{
my $this = shift ;
my ($rec_href) = @_ ;
print "\n\n[update_recording]\n" if $this->debug ;
$this->sql->debug($this->debug) ;
Linux::DVB::DVBT::Apps::QuartzPVR::Base::DbgTrace::startfn('update_recording') ;
# prepare search vars
scripts/dvbt-iplay view on Meta::CPAN
push @get, $href ;
}
Linux::DVB::DVBT::prt_data("Get list=", \@get) if $DEBUG>=2 ;
return @get ;
}
#-----------------------------------------------------------------------------
# Update the 'get' list with the latest download history
sub update_iplay
{
my ($get_aref, $history_href) = @_ ;
print STDERR "update_iplay()\n" if $DEBUG ;
foreach my $entry_href (@$get_aref)
{
my $id = $entry_href->{'pid'} ;
# check download history
view all matches for this distributionview release on metacpan - search on metacpan
( run in 1.482 second using v1.00-cache-2.02-grep-82fe00e-cpan-4673cadbf75 )