Skip to content

Commit

Permalink
TVDB-API-0.36
Browse files Browse the repository at this point in the history
  • Loading branch information
behanw committed Jul 20, 2011
1 parent ba0ba60 commit 53d0f5c
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions lib/TVDB/API.pm
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ use XML::Simple;

use vars qw($VERSION %Defaults %Url);

$VERSION = "0.35";
$VERSION = "0.36";

# TheTVDB Urls
%Url = (
Expand Down Expand Up @@ -257,8 +257,11 @@ sub _downloadZip {
my $url = sprintf($fmt, $self->{zipURL}, @parm, 'zip');
my $obj = new IO::Uncompress::Unzip \$zip, MultiStream => 1, Transparent => 1
or die "IO::Uncompress::Unzip failed: $url\n";
local $/ = undef;
my $xml = <$obj>;
my $xml;
{
local $/ = undef;
$xml = <$obj>;
}

# Make en.xml/banners.xml/actors.xml into one xml file
if ($xml =~ s/<\/Data><\?xml.*?Banners>|<\/Banners><\?xml.*?Actors>//gs) {
Expand Down Expand Up @@ -415,7 +418,11 @@ sub getBannerUpdate {

# Don't update if it isn't newer
return unless -z $filename || $time > &_mtime($filename);
$self->getBanner($banner->{path}, undef, 1);
if (ref($banner) eq 'HASHREF') {
$self->getBanner($banner->{path}, undef, 1);
} else {
$self->getBanner($banner, undef, 1);
}
}

###############################################################################
Expand Down

0 comments on commit 53d0f5c

Please sign in to comment.