mass update photo date/time and hidden status

neerav

Joined: 2007-03-14
Posts: 10
Posted: Wed, 2007-03-21 11:11

First, I must say that I've been using Gallery for a couple week now and IT'S GREAT. While trying a number of photo gallery apps, Gallery hooked me in minutes. The final nail on the [decision] coffin was the *extreme* ease in upgrading from 2.1 to 2.2. Hook, line, sinker. :-)

Minor little problem. The camera's date/time was incorrect for many of the photos that are being used. Can someone guide me as to the database tables/entries that need to be changed. I will then write one sql query to do the dirty work. Changing them individually through the web interface is very time consuming.

This next request may be more complicated. I wish to quickly edit the "hidden" flag for large numbers of photos. e.g. I have pict1, pict2, pict3... pict9 and I want to hide picts 2, 5, 6, 8 quickly. Right now, I have to find the picture, edit, set the flag, save, back to picture, and then find the next pict. I'm having trouble finding the flag in the vast database of 56 tables.

--
Neerav

 
valiant

Joined: 2003-01-04
Posts: 32509
Posted: Wed, 2007-03-21 12:00

thanks for your kind words. :)

@date:
each item has 3 major timestamps. creationTimestamp, modificationTimestamp (both related to when an item was added in g2 and when it was last modified) and the one you probably mean is the originationTimestamp, which should be interpreted as when the photo was taken / shot.

the format is unix timestamp (seconds since 1.1.1970) and it's stored in the db table g2_Item column g_originationTimestamp.
after running your SQL, be sure to clear G2's DB cache: FAQ: How can I clear cached data?

@hidden:
it's just a flag in the user interface, but it's much more than that in the database.
the way to go wouldn't be a sql script, but a PHP script using g2's API to go through a list of items and hide them.

--------------
Doumentation: Support / Troubleshooting | Installation, Upgrade, Configuration and Usage

 
neerav

Joined: 2007-03-14
Posts: 10
Posted: Wed, 2007-03-21 12:38

You're welcome. Kind words are very much deserved for Gallery. Additional support is also deserved and will get to that soon enough.

I appreciate the quick support. Thank you for the information. Problem solved.

--
Neerav

 
neerav

Joined: 2007-03-14
Posts: 10
Posted: Wed, 2007-03-28 06:38
valiant wrote:
after running your SQL, be sure to clear G2's DB cache: FAQ: How can I clear cached data?

What is the difference between the method described in the FAQ vs. Site Admin -> Admin Options:Gallery:Maintenance -> Delete database cache ?

--
Neerav

 
valiant

Joined: 2003-01-04
Posts: 32509
Posted: Wed, 2007-03-28 11:13

the lib/support/ method is accessible in emergency situations and can delete more than just the db and template cache.

--------------
Doumentation: Support / Troubleshooting | Installation, Upgrade, Configuration and Usage

 
neerav

Joined: 2007-03-14
Posts: 10
Posted: Wed, 2007-03-28 11:23

Thank you once more.

--
Neerav

 
BassPlaya
BassPlaya's picture

Joined: 2007-07-06
Posts: 11
Posted: Mon, 2009-08-17 03:03

how do you run such an SQL? I'd love to learn.
Could you post a dummy SQL on how you would do that?
That would solve my problem too, same problem.

Thanx in advance!