Browse Source

Merge branch 'master' of https://github.com/electerious/Lychee into uploader

Conflicts:
	assets/css/upload.css
	assets/min/main.css
	assets/min/main.js
Tobias Reich 10 years ago
parent
commit
3e019af823

+ 0 - 1
assets/js/search.js

@@ -35,7 +35,6 @@ search = {
 					if (data&&data.photos) {
 						album.json = { content: data.photos };
 						$.each(album.json.content, function() {
-							album.parse(this);
 							photosData += build.photo(this);
 						});
 					}

File diff suppressed because it is too large
+ 0 - 0
assets/min/main.js


+ 1 - 1
php/database/update_020505.php

@@ -10,7 +10,7 @@
 if (!$database->query("SELECT `checksum` FROM `lychee_photos` LIMIT 1;")) {
 	$result = $database->query("ALTER TABLE `lychee_photos` ADD `checksum` VARCHAR(100) DEFAULT NULL");
 	if (!$result) {
-		Log::error($database, 'update_020500', __LINE__, 'Could not update database (' . $database->error . ')');
+		Log::error($database, 'update_020505', __LINE__, 'Could not update database (' . $database->error . ')');
 		return false;
 	}
 }

+ 1 - 1
php/modules/Album.php

@@ -99,7 +99,7 @@ class Album extends Module {
 			$photo['nextPhoto']			= '';
 			$photo['thumbUrl']			= LYCHEE_URL_UPLOADS_THUMB . $photo['thumbUrl'];
 
-			if ($photo['takestamp']!=='0') {
+			if (isset($photo['takestamp'])&&$photo['takestamp']!=='0') {
 				$photo['cameraDate']	= 1;
 				$photo['sysdate']		= date('d F Y', $photo['takestamp']);
 			}

+ 6 - 2
php/modules/Photo.php

@@ -113,6 +113,10 @@ class Photo extends Module {
 				}
 			}
 
+			# Calculate checksum
+			$checksum = sha1_file($path);
+			if ($checksum===false) $checksum = '';
+
 			# Read infos
 			$info = $this->getInfo($path);
 
@@ -159,7 +163,7 @@ class Photo extends Module {
 					'" . $albumID . "',
 					'" . $public . "',
 					'" . $star . "',
-					'" . md5_file($path) . "');";
+					'" . $checksum . "');";
 			$result = $this->database->query($query);
 
 			if (!$result) {
@@ -407,7 +411,7 @@ class Photo extends Module {
 			}
 
 			$photo['original_album']	= $photo['album'];
-			$photo['album']			= $albumID;
+			$photo['album']				= $albumID;
 
 		}
 

+ 2 - 1
php/modules/misc.php

@@ -19,6 +19,7 @@ function search($database, $settings, $term) {
 	$result = $database->query("SELECT id, title, tags, public, star, album, thumbUrl FROM lychee_photos WHERE title like '%$term%' OR description like '%$term%' OR tags like '%$term%';");
 	while($row = $result->fetch_assoc()) {
 		$return['photos'][$row['id']]				= $row;
+		$return['photos'][$row['id']]['thumbUrl']	= LYCHEE_URL_UPLOADS_THUMB . $row['thumbUrl'];
 		$return['photos'][$row['id']]['sysdate']	= date('d M. Y', substr($row['id'], 0, -4));
 	}
 
@@ -38,7 +39,7 @@ function search($database, $settings, $term) {
 		$result2	= $database->query("SELECT thumbUrl FROM lychee_photos WHERE album = '" . $row->id . "' " . $settings['sorting'] . " LIMIT 0, 3;");
 		$k			= 0;
 		while($row2 = $result2->fetch_object()){
-			$return['albums'][$row->id]["thumb$k"] = $row2->thumbUrl;
+			$return['albums'][$row->id]["thumb$k"] = LYCHEE_URL_UPLOADS_THUMB . $row2->thumbUrl;
 			$k++;
 		}
 

Some files were not shown because too many files changed in this diff