Home
  About | Download | Features | Shots | Docs | Geeks | SF  
 
 
Obsequieum Tools


Table of contents:

For each of these scripts, please check the usage statement for details on the command line arguments.


CleanUp.pl


Installed to: /usr/local/obs/tools

The CleanUp.pl script carries out the following tasks:

  • Arrange the mp3 files to reflect the data in the SQL server
  • Attach ID3v1 and ID3v2 tags to the mp3 files
Running CleanUp.pl without any arguments will name and arrange the mp3 files into directories and files named after the data that is stored in the SQL server. You can use the admin features of the Obs web interface to massage the data to your liking and then run CleanUp.pl to make the physical file/path naming match up with the metadata.

There are two relevant settings in obs.conf that determine how the directories and files will be laid out. First the FileMask string determines the layout of the paths and files, and AllowedChars determines which characters are legal for naming the files and paths.

The FileMask string may contain any number of the four special variables %artist, %album, %track, and %title. In order to determine where to store an mp3 file, the CleanUp.pl script will take the FileMask string and replace the special variables with the actual values for the given track. The resultant string determines the path/filename where the mp3 file will be stored, relative to the Volume root.

For example, if you have the FileMask "/%artist/%album/%title.mp3" and the track Strangers by Portishead off the Dummy album you'd get the following path/file: "/Portishead/Dummy/Strangers.mp3"

If you prefer to store your mp3s in one directory, you might try this FileMask: "(%artist)-%album-[%track]-%title.mp3", which would yield the file "(Portishead)-Dummy-[03]-Strangers.mp3", which would be stored in the same directory as the corresponding Volume file.

The AllowedChars string determines which characters are valid to use for path and filenames. If you'd like to use upper and lower case characters, digits and space (the default) you'd set AllowedChars to 'A-Za-z0-9 '. If you'd prefer to just do lowercase files, set AllowedChars to 'a-z0-9 '.

If you give the CleanUp.pl script the -t option it will run through the database and tell you what it would rename files to without actually renaming the files. The -1 option to the script will also have the script write ID3v1 tags to the files, and the -2 option will write ID3v2 tags.


AddFiles.pl


Installed to: /usr/local/obs/tools

The AddFiles.pl script can be used to search for existing mp3 files and import then into Obs. This script does not require the obs server to be running, but it requires MySQL to be running.

The AddFiles script will recursively search the paths given on the command line and add any mp3 files it finds to the local Obs server. The script will read ID3v1, ID3v2 tags from the files, and even based on the name of the file it will attempt to extract information about the Artist, Title and Album.

For instance, if you have your mp3 collection stashed in /mnt/mp3, make sure to create a Volume file in /mnt/mp3 -- AddFiles.pl requires a Volume file to be present in the specified path. If it cannot find the Volume file in the specified path it will scan upwards in the path to find a Volume files. So, if you want to cheat and have all your mp3s in your file system use one Volume file, simply create the file Volume file in /. :-)

AddFiles.pl can be run in test mode (-t) and it will search for mp3s, but it will not actually add them to the server. It can also be run in update mode where it will add new files and update the metadata on existing files -- without the -u file existing files are skipped.

If you have all of your mp3 files oranigzed in a particular file naming scheme, you can import the meta data (artist, album, track, and title) straight from the file name. You will need to define the filename pattern that AddFiles.pl should use in /usr/local/obs/etc/obs.conf.

For instance, if your files are laid out like:

(Portishead)-Dummy-[03]-Strangers.mp3
Then set the ImportFileMask in obs.conf to:
ImportFileMask (%artist)-%album-[%track]-%title.mp3
AddFiles.pl will first parse the filenames of found mp3s to see if they match the ImportFileMask string. If so it will parse the meta data out of the file name. Then it will try to find data in an ID3v1 tag and then it will try to find data in an ID3v2 tag. Note that data found in an ID3v2 tag overrides the data in an ID3v1 tag, which in turn overrides the data found in the filename.


RipCd.pl


Installed to: /usr/local/bin

This script will identify a CD via CDDB, rip the tracks using CDParanoia, encode them to MP3 and then submit them to the Obseqieum server.

Use the script like this:

# Get a listing of all the options RipCd.pl --help # Rip, encode and submit entire CD. RipCd.pl # Rip, encode and submit tracks 1, 3, and 5 RipCd.pl -t 1 3 5 # Rip, encode and submit entire CD to obs # server obs.yourobs.net RipCd.pl -s obs.yourobs.net


SubmitTrack.pl


Installed to: /usr/local/bin

SubmitTrack.pl allows the user to submit a MP3 file to an Obs server. The script can take the necessary information (Title, artist, album) from the ID3 tag or you can supply it on the command line.


Rip.pl


Installed to: /usr/local/bin

This script will allow you to download a playlist from the Obs server straight into your Rio. This requires the rio program from the Snowblind Alliance.


CheckLocalFiles.pl


Installed to: /usr/local/obs/tools

This script will check to make sure that all the files that are listed in the SQL server are present on the filesystem. A local file is a file that resides on a hard disk. Given that, this script will not check for files on a CD changer.

Without any arguments this script will show what files are missing. If you give the -f (fix) option, it will remove the database entries for these missing files.


ClearCache.pl


Installed to: /usr/local/obs/tools

This script will clear top three songs in the play queue.


CreateTables.pl


Installed to: /usr/local/obs/tools

This script is used by install-db.pl to create the initial tables needed by Obs.


RemoveEmpties.pl


Installed to: /usr/local/obs/tools

This script will list all the albums that have no tracks and all artists that have no albums. If you specify the -f option, these listed files will be removed from the database.