Skip to content

Commit

Permalink
TTO-135 Identify item pool for UK and Australian authors (#112)
Browse files Browse the repository at this point in the history
* TTO-135 Identify item pool for UK and Australian authors
- Re-enable in Commonwealth project country list.
- Update cutoff dates based on spec in TTO ticket.
- Relax English requirement.
  • Loading branch information
moseshll authored Oct 12, 2023
1 parent 38fed4a commit 48063ec
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 9 deletions.
2 changes: 1 addition & 1 deletion cgi/CRMS.pm
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ sub new
return $self;
}

our $VERSION = '8.5.15';
our $VERSION = '8.5.16';
sub Version
{
return $VERSION;
Expand Down
13 changes: 7 additions & 6 deletions cgi/Project/Commonwealth.pm
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,10 @@ sub new
return $class->SUPER::new(@_);
}

# 2023 Commonwealth reactivation only for Canada
my $CANDIDATE_COUNTRIES = {
# 'Australia' => 1,
'Australia' => 1,
'Canada' => 1,
# 'United Kingdom' => 1
'United Kingdom' => 1
};

# ========== CANDIDACY ========== #
Expand All @@ -38,6 +37,8 @@ sub EvaluateCandidacy {
my $type = substr($leader, 6, 1);
my $date1 = substr($leader, 7, 4);
my $date2 = substr($leader, 11, 4);
# Dates like "192u" could be handled like pub date ranges if we had an
# "actual pub date" UI.
push @errs, "pub date not completely specified ($date1,$date2,'$type')";
}
# Check country of publication
Expand All @@ -52,8 +53,8 @@ sub EvaluateCandidacy {
push @errs, 'non-BK format' unless $record->isFormatBK($id);
return {'status' => 'no', 'msg' => join '; ', @errs} if scalar @errs;
my $src;
my $lang = $record->language;
$src = 'language' if 'eng' ne $lang;
#my $lang = $record->language;
#$src = 'language' if 'eng' ne $lang;
$src = 'translation' if $record->isTranslation;
my $date = $self->{crms}->FormatPubDate($id, $record);
$src = 'date range' if $date =~ m/^\d+-(\d+)?$/;
Expand All @@ -67,7 +68,7 @@ sub year_range {
my $year = shift || $self->{crms}->GetTheYear();

if ($country eq 'United Kingdom' || $country eq 'Australia') {
return [$year - 125, $year - 71]
return [$year - 124, $year - 83]
}
# Magic hardcoded 1971 based on regime changes, not rolling wall.
return [$year - 125, 1971] if $country eq 'Canada';
Expand Down
4 changes: 2 additions & 2 deletions t/Project/Commonwealth.t
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ ok(defined $proj);
subtest 'Commonwealth::year_range' => sub {
my $year = 2020;
my $test_data = {
'United Kingdom' => [1895, 1949],
'Australia' => [1895, 1949],
'United Kingdom' => [1896, 1937],
'Australia' => [1896, 1937],
'Canada' => [1895, 1971],
'Undetermined' => [0, 0]
};
Expand Down

0 comments on commit 48063ec

Please sign in to comment.