Changeset 454

Show
Ignore:
Timestamp:
01/10/07 23:31:27 (6 years ago)
Author:
max
Message:

Per-region grabber support

Files:
2 modified

Legend:

Unmodified
Added
Removed
  • applications/shepherd

    r449 r454  
    22 
    33my $progname = 'shepherd'; 
    4 my $version = '0.4.35'; 
     4my $version = '0.4.36'; 
    55 
    66# tv_grab_au 
     
    21012101        } 
    21022102 
    2103         if ($grabber =~ /\[cache\]/) 
     2103        if (!supports_region($grabber)) 
     2104        { 
     2105            $hits = 0; 
     2106        } 
     2107        elsif ($grabber =~ /\[cache\]/) 
    21042108        { 
    21052109            $hits = find_cache_hits($grabber, $key); 
     
    22232227} 
    22242228 
     2229# Returns 1 if the grabber supports our set region, else 0 
     2230sub supports_region 
     2231{ 
     2232    my ($grabber) = @_; 
     2233 
     2234    my $rsupport = query_config($grabber, 'regions'); 
     2235    return 1 unless ($rsupport);    # Empty string means full support 
     2236 
     2237    my $match = ($rsupport =~ /\b$region\b/); 
     2238    my $exceptions = ($rsupport =~/^-/); 
     2239    return ($match != $exceptions); 
     2240} 
     2241 
    22252242# Return 0 if the grabber can't provide data for this day, 
    22262243# 1 if it can reliably, and 0.5 if it can unreliably. 
  • status

    r453 r454  
    1 application     shepherd            0.4.35 
     1application     shepherd            0.4.36 
    22grabber         yahoo7widget        1.76 
    33grabber         rex                 3.3.9-r1