1 package NonameTV
::DataStore
::Dummy
;
9 NonameTV::DataStore::Dummy
13 Dummy-interface to the datastore for NonameTV. Prints debugging
14 information to STDOUT. Does not touch the database for StartBatch,
15 AddProgramme and EndBatch. All other requests are sent to the
20 use base
'NonameTV::DataStore';
25 my $class = ref($proto) || $proto;
26 my $self = $class->SUPER::new
( @_ );
27 bless ($self, $class);
40 my( $self, $batchname ) = @_;
42 print "StartBatch $batchname\n";
43 $self->{currbatch
} = $batchname;
44 $self->{currbatchname
} = $batchname;
45 $self->{last_end
} = "1970-01-01 00:00:00";
50 my( $self, $success ) = @_;
52 print "EndBatch $success\n";
53 delete $self->{currbatch
};
58 my( $self, $data ) = @_;
60 print "AddProgramme $data->{start_time} $data->{title}\n";
61 print "End: $data->{end_time}\n" if exists( $data->{end_time
} );
62 print "Desc: $data->{description}\n" if exists( $data->{description
} );
63 print "Episode: $data->{episode}\n" if exists( $data->{episode
} );
65 die "You must call StartBatch before AddProgramme"
66 unless exists $self->{currbatch
};
68 if( $self->{last_end
} gt $data->{start_time
} )
70 print STDERR
$self->{currbatchname
} .
71 " Starttime must be later than or equal to last endtime: " .
72 $self->{last_end
} . " -> " . $data->{start_time
} . "\n";
76 $self->{last_end
} = $data->{start_time
};
78 if( defined( $data->{end_time
} ) )
80 if( $data->{start_time
} ge $data->{end_time
} )
82 print STDERR
$self->{currbatchname
} .
83 " Stoptime must be later than starttime: " .
84 $data->{start_time
} . " -> " . $data->{end_time
} . "\n";
87 $self->{last_end
} = $data->{end_time
};
90 $data->{batch_id
} = $self->{currbatch
};
92 if( defined( $data->{category
} ) )
94 my $cat = join "++", @
{$data->{category
}};
95 $data->{category
} = $cat;
96 print "Category: $data->{category}\n";
100 delete( $data->{category
} );
107 Copyright (C) 2004 Mattias Holmlund.