[Slim-Checkins] r33713 - /7.7/trunk/server/Slim/Utils/DbCache.pm

[email protected]
Newsgroups gmane.music.equipment.slimdevices.cvs
Message-ID <[email protected]>
Author: mherger
Date: Wed Nov 16 23:10:16 2011
New Revision: 33713

URL: http://svn.slimdevices.com/slim?rev=33713&view=rev
Log:
Bug: n/a
Description: timestamp of -1 is considered to never expire

Modified:
    7.7/trunk/server/Slim/Utils/DbCache.pm

Modified: 7.7/trunk/server/Slim/Utils/DbCache.pm
URL: http://svn.slimdevices.com/slim/7.7/trunk/server/Slim/Utils/DbCache.pm?rev=33713&r1=33712&r2=33713&view=diff
==============================================================================
--- 7.7/trunk/server/Slim/Utils/DbCache.pm (original)
+++ 7.7/trunk/server/Slim/Utils/DbCache.pm Wed Nov 16 23:10:16 2011
@@ -157,7 +157,7 @@
 	my ( $expiry ) = @_;
 	
 	# see below - 'never' would crash 
-	$expiry = -1 if $expiry eq 'never';
+	return -1 if $expiry eq 'never' || $expiry eq '-1';
 	
 	if ( $expiry && $expiry !~ /^[\-]*\d+$/ ) {
 		# Not a number, need to canonicalize it
@@ -175,7 +175,7 @@
 
 	# "If value is less than 60*60*24*30 (30 days), time is assumed to be
 	# relative from the present. If larger, it's considered an absolute Unix time."
-	if ( $expiry <= 2592000 ) {
+	if ( $expiry <= 2592000 && $expiry > -1 ) {
 		$expiry += time();
 	}
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.