Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Looking for MP3/Ogg sorter/filer thing :)
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Multimedia
View previous topic :: View next topic  
Author Message
puddpunk
l33t
l33t


Joined: 20 Jul 2002
Posts: 681
Location: New Zealand

PostPosted: Thu May 01, 2003 7:23 am    Post subject: Looking for MP3/Ogg sorter/filer thing :) Reply with quote

Hi there,

I've got a lot (~400) ogg files, that are siting in a dir and I want them sorted into subdirs, and the tracks renamed.

e.g.
music/Artist/Album/TrackNumber - Artist - TrackName
music/311/SoundSystem/02 - 311 - Come Original.ogg

And at the moment they are sitting in the music dir like:

music/311 - Come Original.ogg

So all the information needed is in the Ogg track tags (I've made sure of it!). Now I could do it myself, but, I'm sure there must be a program that can do this? I've had a look at cantus, and that doesn't seem to quite fit the bill (can't create dirs based on ID3/Ogg tags).

Any help appreciated,
Thanks,
Chris.
Back to top
View user's profile Send private message
Zapp!
Tux's lil' helper
Tux's lil' helper


Joined: 11 Oct 2002
Posts: 77
Location: Germany

PostPosted: Thu May 01, 2003 8:41 am    Post subject: Reply with quote

I don't know a program that would automatically create subdirs, but Easytag is very good in renaming lots of files.
You could use it to rename your files to something like this:

artist - album - tracknumber - track.ogg

Now it's easyer to move them in subdirs, manually.
Back to top
View user's profile Send private message
ghetto
Guru
Guru


Joined: 10 Jul 2002
Posts: 369
Location: BC, Canada

PostPosted: Thu May 01, 2003 10:54 pm    Post subject: Reply with quote

...this is prolly not what your looking for..
but net-rhythmbox is good for viewing all of your music files with it has seperate windows for album, artis, title, etc etc..

Ive never heard of a program to sort and create dirs based on id3tags
_________________
Blizzard you suck.
Back to top
View user's profile Send private message
puddpunk
l33t
l33t


Joined: 20 Jul 2002
Posts: 681
Location: New Zealand

PostPosted: Fri May 02, 2003 12:26 am    Post subject: Reply with quote

Damn! Looks like i'll have to write one then :)

Python...Here I come!
Back to top
View user's profile Send private message
puddpunk
l33t
l33t


Joined: 20 Jul 2002
Posts: 681
Location: New Zealand

PostPosted: Sat May 03, 2003 3:48 am    Post subject: Reply with quote

Well, I made good on my threat and made my own one. Hah! 20 minutes and 24 lines of code later, I've done it, and my .ogg's have never been tidier.

For other people who might need to use this, you need to:
Code:
# emerge pyogg pyvorbis


Then take my program:
Code:
#!/usr/bin/python
import ogg.vorbis
import os

topdir = '/music/'
def isogg(file):
   if file[-4:] == '.ogg':
      return 1
   else:
      return 0

files = filter(isogg, os.listdir(topdir))
files.sort()
for file in files:
   oggfile = ogg.vorbis.VorbisFile(topdir + '/' + file)
   oggcomments = oggfile.comment().as_dict()
   print 'Moving', topdir + '/' + file, "to", topdir + '/' + oggcomments['ARTIST'][0] + '/' \
      + oggcomments['ALBUM'][0] + '/' + file
   try:
      os.makedirs(topdir + '/' + oggcomments['ARTIST'][0] + '/' + oggcomments['ALBUM'][0])
   except OSError:
      pass
   os.rename(topdir + '/' + file, topdir + '/' + oggcomments['ARTIST'][0] + '/' + \
      oggcomments['ALBUM'][0] + '/' + file)

and change the topdir variable so that it points to your base music directory. Also, if you want to change the format, it would take some minor hacking, nothing serious.

Any enhancements welcome (also perhaps minor feature requests) :)
Back to top
View user's profile Send private message
ghetto
Guru
Guru


Joined: 10 Jul 2002
Posts: 369
Location: BC, Canada

PostPosted: Sat May 03, 2003 4:36 am    Post subject: Reply with quote

i bet that felt really good to scratch that itch :D good job!!
_________________
Blizzard you suck.
Back to top
View user's profile Send private message
puddpunk
l33t
l33t


Joined: 20 Jul 2002
Posts: 681
Location: New Zealand

PostPosted: Sat May 03, 2003 4:56 am    Post subject: Reply with quote

damn straight, nothing like killing a mosquito with a high-level language like python! ;)
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Multimedia All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum