Convert files and keep structure Convert files and keep structure
 

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

Convert files and keep structure

Started by Tchit, December 20, 2007, 01:06:17 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Tchit

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 !

Nibbler

You can edit the filename directly in the database using phpmyadmin.

Tchit

Yes but what if I want to change the extension of 7000 files ?  :'(

Nibbler

Run an SQL query to change them all at once.

Tchit

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 !

Nibbler

Something like


UPDATE cpg_pictures SET filename = REPLACE(filename, '.wmv', '.flv')


Backup first.

Tchit

Thank you thousand times !

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