Support and General Use > Plugins/Viewers

Mass rename of .bmp files for Picture Flow Plugin

(1/1)

Phalangees:
Hello Everyone,

I have a quick question.

The Picture Flow plugin doesn't seem to support files that aren't named cover.bmp. I have a lot that are named cover.240x240.bmp but I figured I could just rename those to cover.bmp.

Here's where I encounter the problem.

I'm not very good at shell commands in linux so I was hoping someone could help me out. I have album art for my albums in the album folder named cover.240x240.bmp and I need to rename it to cover.bmp. The thing is, I have hundreds of albums so doing it individually would be incredibly time consuming.

This is what my directory setup is like:

+Music
-+Artist Name
--+Album 1
---+Music File 1
---+Music File 2
---+cover.240x240.bmp
--+Album 2
---+Music File 1
---+Music File 2
-+Artist 2
--+Album 1
---+cover.240x240.bmp
...etc. Hopefully you get the idea.

If anyone knows a shell command to do this please let me know.

If this is in the wrong forum, please feel free to move it.

Thank you all so much!!

cool_walking_:
Better to ask this at a Linux forum.

I'm not very good at..... things, but maybe this will work.  Or maybe it will screw up all your filenames. prename is in the perl package. Run it from the "Music" directory.


--- Code: ---prename 's/^cover\.240x240\.bmp$/cover\.bmp/' */*/cover.240x240.bmp
--- End code ---

Horscht:
I haven't used linux in a while, but i guess this would work:

#!/bin/sh
find -iname "cover.240x240.bmp" | while read file
    do mv "$file" "${file%/*}"/cover.bmp

done

or something along those lines. You'd run this script from the root of your music player

EDIT: I am not sure about the syntax of the mv line

Phalangees:
I was able to get it using the following which I got from a friend who is good with shell commands:


--- Code: ---find /home/username/music -name 'cover.240x240.bmp' -type f -exec rename -n 's/cover.240x240.bmp/cover.bmp/' '{}' ';'
--- End code ---

Thanks for all your help!

cool_walking_:
You need to take that "-n" out if you want it to do anything.


--- Quote from: man rename ----n, --no-act
               No Action: show what files would have been renamed.
--- End quote ---

Navigation

[0] Message Index

Go to full version