Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
SRCT
photos
Commits
34cae0db
Commit
34cae0db
authored
Jul 05, 2014
by
Tobias Reich
Browse files
Merge branch 'pyro2927-feature/photo_checksum'
parents
8e8fd914
c064c1c0
Changes
7
Expand all
Hide whitespace changes
Inline
Side-by-side
assets/js/lychee.js
View file @
34cae0db
...
...
@@ -8,8 +8,8 @@
var
lychee
=
{
title
:
""
,
version
:
"
2.5
"
,
version_code
:
"
02050
0
"
,
version
:
"
2.5
.5
"
,
version_code
:
"
02050
5
"
,
api_path
:
"
php/api.php
"
,
update_path
:
"
http://lychee.electerious.com/version/index.php
"
,
...
...
assets/min/main.js
View file @
34cae0db
This diff is collapsed.
Click to expand it.
assets/min/view.js
View file @
34cae0db
This diff is collapsed.
Click to expand it.
php/database/photos_table.sql
View file @
34cae0db
...
...
@@ -23,5 +23,6 @@ CREATE TABLE IF NOT EXISTS `lychee_photos` (
`star`
tinyint
(
1
)
NOT
NULL
,
`thumbUrl`
varchar
(
50
)
NOT
NULL
,
`album`
varchar
(
30
)
NOT
NULL
DEFAULT
'0'
,
`checksum`
VARCHAR
(
100
)
DEFAULT
NULL
,
PRIMARY
KEY
(
`id`
)
)
ENGINE
=
MyISAM
DEFAULT
CHARACTER
SET
utf8
COLLATE
utf8_general_ci
;
\ No newline at end of file
php/database/update_020505.php
0 → 100644
View file @
34cae0db
<?php
###
# @name Update to version 2.5.5
# @author Tobias Reich
# @copyright 2014 by Tobias Reich
###
# Add `checksum`
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
.
')'
);
return
false
;
}
}
# Set version
$result
=
$database
->
query
(
"UPDATE lychee_settings SET value = '020505' WHERE `key` = 'version';"
);
if
(
!
$result
)
{
Log
::
error
(
$database
,
'update_020505'
,
__LINE__
,
'Could not update database ('
.
$database
->
error
.
')'
);
return
false
;
}
?>
\ No newline at end of file
php/modules/Database.php
View file @
34cae0db
...
...
@@ -46,7 +46,8 @@ class Database extends Module {
'020100'
,
#2.1
'020101'
,
#2.1.1
'020200'
,
#2.2
'020500'
#2.5
'020500'
,
#2.5
'020505'
#2.5.5
);
# For each update
...
...
php/modules/Photo.php
View file @
34cae0db
...
...
@@ -130,7 +130,7 @@ class Photo extends Module {
}
# Save to DB
$query
=
"INSERT INTO lychee_photos (id, title, url, description, tags, type, width, height, size, iso, aperture, make, model, shutter, focal, takestamp, thumbUrl, album, public, star)
$query
=
"INSERT INTO lychee_photos (id, title, url, description, tags, type, width, height, size, iso, aperture, make, model, shutter, focal, takestamp, thumbUrl, album, public, star
, checksum
)
VALUES (
'"
.
$id
.
"',
'"
.
$info
[
'title'
]
.
"',
...
...
@@ -151,7 +151,8 @@ class Photo extends Module {
'"
.
md5
(
$id
)
.
".jpeg',
'"
.
$albumID
.
"',
'"
.
$public
.
"',
'"
.
$star
.
"');"
;
'"
.
$star
.
"',
'"
.
md5_file
(
$path
)
.
"');"
;
$result
=
$this
->
database
->
query
(
$query
);
if
(
!
$result
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment