script/show_conflicts.pl untested

filter: Statementstmt 0.0% 0 / 26 Branchbran 0.0% 0 / 2 Conditioncond 0.0% 0 / 2 MC/DCmcdc 0.0% 0 / 1 Subroutinesub 0.0% 0 / 4 Podpod n/a totaltotal 0.0% 0 / 35 CC 1 SCAR 6.9
CC
1
Cov
0%
BEGIN
2.0
BEGIN
2.0
BEGIN
2.0
CRAP 2.0
1 #!/usr/bin/env perl
2  
3 use strict;
4 use warnings;
5  
6 our $VERSION = '0.09'; # VERSION
7  
8 use Video::PlaybackMachine::DB;
9 use Video::PlaybackMachine::Config;
10  
11 @ARGV==2 or die "Usage: $0 START_TIME DURATION\n";
12  
13 my ($start_time, $duration) = @ARGV;
14  
15 MAIN: {
16  
17 my $schema = Video::PlaybackMachine::DB->schema();
18 my $config = Video::PlaybackMachine::Config->config();
19 my $schedule = $schema->resultset('Schedule')->find({'name' => $config->schedule});
20
21 my @results = $schedule->movie_conflicts($start_time, $duration);
22
23 if (scalar @results) {
24 foreach my $conflict (@results) {
25 print "Conflict: ", $conflict->mrl(), "\n";
26 }
27 }
28 else {
29 print "No conflicts.\n";
30 }
31  
32 }