-
Notifications
You must be signed in to change notification settings - Fork 2
/
README
161 lines (134 loc) · 6.33 KB
/
README
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
About
=====
Locutus is a software that compares audio files with the MusicBrainz database,
updates the metadata in the files and stores the files in a structured
directory.
This project is still quite young, there may be bugs and I won't guarantee that
it won't erase any files. That said, I still haven't lost a single file due to
Locutus, so the risk is low.
Some of Locutus' features:
- Capable of handling extremely large music archives with low CPU and memory
usage.
- Clever metadata matching that's extensively configurable. As long as the
metadata found in audio files are correct Locutus mismatch files very rarily.
It is however possible to configure Locutus in a way that will cause
mismatched files, use precaution!
- Locutus is split in 3 parts, the daemon, the database and a user interface.
Each part can run on its own computer, or they can all run on the same
computer. While the daemon compares files, updates metadata and store the
files, you can manually match the files the daemon was unable to automatically
match in a user interface (currently there's a web interface and a Java
interface).
- Albums retrieved from MusicBrainz are stored in a local cache, reducing amount
of queries sent, and thus also reducing load generated on MusicBrainz.
When manually matching files with tracks no requests are sent to MusicBrainz.
- Grouping files in assumed albums. To reduce amount of queries sent to
MusicBrainz the files are placed in groups that are assumed to be albums. This
makes Locutus look up the first file in a group, fetch the best matching
albums for that track and compare the other files in the group with those
albums. If some of the files have a poor match, those files will be looked up
separately and albums returned from those will also be matched with the other
files in the group.
- Automatically fetch tags from AudioScrobbler as "genre". Currently it only
supports storing the most popular tag. Since it needs to look up each file
this feature significantly slows down Locutus as it may only look up tags once
per second at most. In an effort to speed this up, only files with no genre
set are looked up.
Installation
============
This project is still in an early alpha stage. It's not ready for the public yet
and the installation prosess requires some knowledge with Linux.
Database:
---------
Locutus currently supports PostgreSQL version 8.3 or later (not tested on
earlier versions).
1. Become the 'postgres' user:
sudo su - postgres
2. Create a user for Locutus:
createuser -S -D -R -P -E locutus
3. Create a database for Locutus
createdb -O locutus locutus
4. Log out the 'postgres' user and goto the "sql" directory of Locutus where
you issue the following command:
psql -h localhost -f locutus.sql -U locutus locutus
5. You'll need to grant Locutus access to the database. Edit (most likely)
"/etc/postgresql/8.3/main/pg_hba.conf" and add the following entry after
"#TYPE DATABASE USER CIDR-ADDRESS METHOD":
host locutus locutus 127.0.0.1/32 md5
Change the IP if you're running the daemon/web interface on another computer.
6. By default PostgreSQL only listen on 127.0.0.1. If you're accessing the
database from somewhere else, you'll need to edit
"/etc/postgresql/8.3/main/postgresql.conf":
listen_addresses = '*'
7. Restart PostgreSQL:
/etc/init.d/postgresql restart
Daemon:
-------
The daemon requires GNU Common C++, TagLib (version 1.5 or later) and the
PostgreSQL C client library.
For Debian users:
aptitude install libpq-dev libtag1-dev libcommoncpp2-dev build-essential
1. Create a directory for building Locutus and enter the directory:
mkdir build
cd build
2. Generate Makefile:
cmake ..
3. Compile Locutus:
make
If all goes well, you should now have a "locutus" executable in the "build"
directory. Before you can run Locutus you'll need to set up a configuration file
for connecting to PostgreSQL. Copy or symlink the "locutus.conf" file from the
"conf" directory to the build directory and modify its settings if necessary.
You should now be able to run Locutus. If you execute Locutus with "-d" then
Locutus will run as a daemon untill you send a TERM signal to its process.
The first time you run Locutus it will populate the "setting" table with default
values. You'll need to set the "dry_run" setting in the database to "false" when
you want Locutus to actually sort your files.
Java interface:
---------------
Java 1.6 is needed for the Java UI.
More information will come when it is slightly more usable.
Web interface:
--------------
Perl, Apache2 and Template::Toolkit are required for the web interface.
This guide is written for Debian Linux, if you're using another distro you may
need to do things differently. I leave it as an exercise to those readers to
figure this out :)
For Debian users:
aptitude install libapache2-mod-speedycgi libapache-dbi-perl \
templatetoolkit-perl libdbd-pgsql libclass-dbi-pg-perl
1. Open "/etc/apache2/sites-enabled/000-default" in your favourite editor and
add the following lines somewhere in the VirtualHost (changing the paths to
where you got the "web" directory):
Alias /locutus/ "/home/canidae/projects/locutus/web/"
<Directory /home/canidae/projects/locutus/web/>
Options ExecCGI Indexes FollowSymLinks MultiViews
AllowOverride None
Order allow,deny
allow from all
AddHandler cgi-script .pl
</Directory>
2. Restart Apache:
/etc/init.d/apache2 restart
3. Set the connection parameters in the "locutus.conf" file residing in the
"include"-directory.
4. The interface should now be up at "http://localhost/locutus/" (or another URL
if you installed the web interface on another computer). If it isn't, then
check logs in "/var/log/apache2/" and "/var/log/postgresql/".
License
=======
The project is MIT licensed, so you're pretty free to use it as you wish.
If you improve the project then we would greatly appreciate patches, though.
Note:
The web interface is currently GPLv3 licensed. It is deprecated and will
eventually be removed or replaced.
Developers
==========
Vidar Wahlberg, <[email protected]>
Daemon, database, Java interface, web interface
Contributors
============
Kristian Klette, <[email protected]>
Web interface
Per Øyvind Øygard, <[email protected]>
Web interface