Rockbox.org home
Downloads
Release release
Dev builds dev builds
Extras extras
themes themes
Documentation
Manual manual
Wiki wiki
Device Status device status
Support
Forums forums
Mailing lists mailing lists
IRC IRC
Development
Bugs bugs
Patches patches
Dev Guide dev guide
Search



Donate

Rockbox Technical Forums


Login with username, password and session length
Home Help Search Staff List Login Register
News:

Thank You for your continued support and contributions!

+  Rockbox Technical Forums
|-+  Support and General Use
| |-+  Plugins/Viewers
| | |-+  Mass rename of .bmp files for Picture Flow Plugin
« previous next »
  • Print
Pages: [1]

Author Topic: Mass rename of .bmp files for Picture Flow Plugin  (Read 2279 times)

Offline Phalangees

  • Member
  • *
  • Posts: 136
  • Gigabeat F20 and S60
Mass rename of .bmp files for Picture Flow Plugin
« on: April 01, 2009, 10:02:00 PM »
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!!
Logged

Offline cool_walking_

  • Rockbox Expert
  • Member
  • *
  • Posts: 695
Re: Mass rename of .bmp files for Picture Flow Plugin
« Reply #1 on: April 02, 2009, 11:28:23 PM »
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: [Select]
prename 's/^cover\.240x240\.bmp$/cover\.bmp/' */*/cover.240x240.bmp
« Last Edit: April 02, 2009, 11:30:29 PM by cool_walking_ »
Logged

Offline Horscht

  • Member
  • *
  • Posts: 26
Re: Mass rename of .bmp files for Picture Flow Plugin
« Reply #2 on: April 02, 2009, 11:48:35 PM »
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
Logged

Offline Phalangees

  • Member
  • *
  • Posts: 136
  • Gigabeat F20 and S60
Re: Mass rename of .bmp files for Picture Flow Plugin
« Reply #3 on: April 03, 2009, 09:39:56 AM »
I was able to get it using the following which I got from a friend who is good with shell commands:

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

Thanks for all your help!
Logged

Offline cool_walking_

  • Rockbox Expert
  • Member
  • *
  • Posts: 695
Re: Mass rename of .bmp files for Picture Flow Plugin
« Reply #4 on: April 03, 2009, 09:38:28 PM »
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.
Logged

  • Print
Pages: [1]
« previous next »
+  Rockbox Technical Forums
|-+  Support and General Use
| |-+  Plugins/Viewers
| | |-+  Mass rename of .bmp files for Picture Flow Plugin
 

  • SMF 2.0.17 | SMF © 2019, Simple Machines
  • Rockbox Privacy Policy
  • XHTML
  • RSS
  • WAP2

Page created in 0.073 seconds with 15 queries.