GBPVR::CDBI is a database abstraction for GBPVR.
SYNOPSIS
Example to search the program listings:
use GBPVR::CDBI::Programme;
my @rows = GBPVR::CDBI::Programme->search_like(name => 'Star%');
Example to display the recorded shows:
use GBPVR::CDBI::RecordingSchedule;
my @rows = GBPVR::CDBI::RecordingSchedule->search(status => 2);
foreach my $row (@rows){
printf "-----------------------n";
printf "%s - '%s'n", $row->programme_oid->name, $row->programme_oid->sub_title;
printf "n", $row->filename;
printf " %sn", $row->programme_oid->description;
}
Example to show pending shows (yes, you should be able to order_by via search() and not have to call sort):
use GBPVR::CDBI::RecordingSchedule;
my @rows = GBPVR::CDBI::RecordingSchedule->search(status => 0);
@rows = sort { $a->manual_start_time cmp $b->manual_start_time } @rows;
foreach my $row (@rows){
printf "%-20s %8s %s - '%s'n",
$row->manual_start_time,
$row->programme_oid->channel_oid->name,
$row->programme_oid->name,
$row->programme_oid->sub_title;
printf " %sn", $row->programme_oid->description;
}
Example to force all scheduled 'Simpsons' recordings to be low quality:
use GBPVR::CDBI::RecordingSchedule;
my $iterator = GBPVR::CDBI::RecordingSchedule->retrieve_all;
while( my $row = $iterator->next ){
next unless $row->programme_oid->name =~ /simpsons/i;
next if $row->quality_level == 2;
$row->quality_level(2);
$row->update;
}
GBPVR::CDBI::RecordingSchedule->dbi_commit;
Product's homepage
Requirements:
· Perl