forum.coppermine-gallery.net

Support => cpg1.4.x Support => Older/other versions => cpg1.4 miscellaneous => Topic started by: Tchit on December 20, 2007, 01:06:17 pm

Title: Convert files and keep structure
Post by: Tchit on December 20, 2007, 01:06:17 pm
Hi !
First of all, thank you for the fabulous Coppermine :)


This is my question :

I am hosting a Coppermine album with thousands of videos. I am planning to convert all those videos from wmv to flv. But I would like to keep my album as they are, with comments, ratings and number of views. This means the only thing that would change would be the extension of the name of the movie. The URL wouldn't change.
For example the file "movie12568.wmv" would be now : "movie12568.flv" in the same directory, with the same URL, and with the same jpeg file as thumbnail.

Is it possible to do ? And how difficult it is ?


Thank you very much !
Title: Re: Convert files and keep structure
Post by: Nibbler on December 20, 2007, 05:20:57 pm
You can edit the filename directly in the database using phpmyadmin.
Title: Re: Convert files and keep structure
Post by: Tchit on December 20, 2007, 05:28:24 pm
Yes but what if I want to change the extension of 7000 files ?  :'(
Title: Re: Convert files and keep structure
Post by: Nibbler on December 20, 2007, 05:30:20 pm
Run an SQL query to change them all at once.
Title: Re: Convert files and keep structure
Post by: Tchit on December 20, 2007, 05:48:19 pm
Ok thank you, I need to learn this.
I know this is not exactly about Coppermine but do you have any clue where I should look ? Is it a difficult SQL query ?


Thank you very much !
Title: Re: Convert files and keep structure
Post by: Nibbler on December 20, 2007, 05:58:41 pm
Something like

Code: [Select]
UPDATE cpg_pictures SET filename = REPLACE(filename, '.wmv', '.flv')

Backup first.
Title: Re: Convert files and keep structure
Post by: Tchit on December 20, 2007, 06:24:54 pm
Thank you thousand times !

As soon as I convert my files I'll try this.