Clean out old photos from database? Clean out old photos from database?
 

News:

cpg1.5.48 Security release - upgrade mandatory!
The Coppermine development team is releasing a security update for Coppermine in order to counter a recently discovered vulnerability. It is important that all users who run version cpg1.5.46 or older update to this latest version as soon as possible.
[more]

Main Menu

Clean out old photos from database?

Started by fribse, October 20, 2010, 03:34:47 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

fribse

I've posted this under 1.4/misc as well, but I've moved the gallery to 1.5, so this is probably a better place to post it.
After I've renamed some folders that contained pictures already included in albums, it still has the old picturesit fails to load.
I need to have them cleaned out from the database, some sort of 'validate all pictures' would be great, or at least clear out an album for all pictures, so I can readd them.

Αndré

Afaik Coppermine don't has such a mechanism. But you could write a simple script that deletes database entries if the file_exists function detects missing files.

hobert

Here's a small mod I wrote for 1.4 that will automatically check the "delete" box in editpics.php if the original file source is missing.  It's still working fine in 1.5.8 as far as I can tell.

This will also get rid of the thumbnail and other pictures if they are left behind.

http://forum.coppermine-gallery.net/index.php/topic,61925.0.html

fribse1

Very neat mod, but I can't get it working.
Problem is very strange.
If I go to 'edit files' it ONLY lists the files that are really there, not the bad ones that are missing??? So it doesn't show any checkmarks for deleting them :-(
I think the database has gone haywire over this.
I wonder if it will allow me to delete the album in it's enitirity, and just bulk add them back in...

fribse

Can anybody tell me how to directly manipulate the database to completely remove the album (I'll just readd the album afterwards with batch load).

Αndré

If you want to remove the files of an album, you'll have to delete the appropriate entries (have a look at the column 'aid') in the pictures table.
If you want to remove the album, too, you'll have to delete the entry in the albums table.
According to your Coppermine setup you'll have to clean the comments table and maybe the stats tables, too.

fribse

Excellent, got them removed, now on to adding them back in  ;D
Thanks!

Αndré