2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-03-10 09:16:53 +00:00

57_Calendar: enable gzipped ical files (forum #31845)

git-svn-id: https://svn.fhem.de/fhem/trunk@7509 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
borisneubert 2015-01-10 20:19:03 +00:00
parent 9f01bef0ae
commit 13fabcbd8f
2 changed files with 12 additions and 0 deletions

View File

@ -1,5 +1,6 @@
# Add changes at the top of the list. Keep it in ASCII, and 80-char wide.
# Do not insert empty lines here, update check depends on it.
- feature: 57_Calendar: enable gzipped ical files (forum #31845)
- bugfix: 70_Jabber.pm: XMPP DNS SVR record query added
- bugfix: 70_PIONEERAVR: fixed "missed to call readingsBeginUpdate first"
- feature: fhemweb.js rewrite based on jQuery, single-widget-implementation

View File

@ -942,6 +942,17 @@ sub Calendar_GetUpdate($$) {
#main::Debug $ical->asString();
my @entries= @{$ical->{entries}};
if($#entries<0) {
eval { require Compress::Zlib; };
if($@) {
Log3 $hash, 1, "Calendar " . $hash->{NAME} . ": Maybe gzip data, but cannot load Compress::Zlib";
}
else {
$ics = Compress::Zlib::memGunzip($ics);
$ical->parse(split("\n",$ics));
@entries= @{$ical->{entries}};
}
};
if($#entries<0) {
Log3 $hash, 1, "Calendar " . $hash->{NAME} . ": Not an ical file at URL";
$hash->{STATE}= "Not an ical file at URL";