Muggle-plugin

Aus VDR Wiki
Wechseln zu: Navigation, Suche

Inhaltsverzeichnis

Beschreibung

Das Plugin bietet eine Datenbankverbindung für den VDR so dass die Medienauswahl flexibler wird.

Setup

Hardwareanforderungen

Softwareanforderungen

  • mySQL
  • libmad
  • taglib
  • libvorbis und libvorbisfile (optional)

Installation

cd $SOURCEDIR
tar xvzf libmad-<VERSION>.tar.gz
cd libmad-<VERSION>
./configure --prefix=/usr/local
make
make install
ldconfig
cd -

tar xvzf libogg-<VERSION>.tar.gz
cd libogg-<VERSION>
./configure --prefix=/usr/local
make
make install
ldconfig
cd -

tar xvzf libvorbis-<VERSION>.tar.gz
cd libvorbis-<VERSION>
./configure --prefix=/usr/local \
                   --with-ogg-libraries=/usr/local/lib
make
make install
cd -

tar xvzf taglib-<VERSION>.tar.gz
cd taglib-<VERSION>
./configure --prefix=/usr/local
make
make install
ldconfig
cd -

tar xvzf mysql-<VERSION>.tar.gz
./configure --prefix=/usr/local
make
make install
find . -name my-medium.cnf -exec cp --backup=t \{} /etc/my.cnf \;
cd /usr/local/lib
ln -s mysql/* .
groupadd mysql
useradd -g mysql mysql
chown -R mysql var
mysql_install_db --user=mysql &
ldconfig

cd $SOURCEDIR/VDR/PLUGINS/src/muggle/scripts
./make*
  • SuSE
yast -i mysql mysql-client mysql-devel mysql-shared

Konfiguration

Da ich auf meinen PC sämmtliche Software mit --prefix=/usr/local übersetze, müssen wir das Makefile des Plugins anpassen.

-       -I/usr/include/mysql/ -I/usr/include/taglib
+       -I/usr/local/include/mysql/ -I/usr/local/include/taglib

- MIFLAGS += -I/usr/include/taglib -lmysqlclient
+ MIFLAGS += -I/usr/local/include/taglib -lmysqlclient

Starten des Servers mit.

mysqld_safe --user=mysql &

Nun können wir die Datenbank füttern.

cd $SOURCEDIR/VDR/PLUGINS/src/muggle
make mugglei
cd scripts
sh make-empty-db
cd -
find /mp3 -name '*.mp3' -type f -exec ./mugglei -f \{} \;

Patch:

diff -Nur muggle-0.0.7/mugglei.c muggle-0.0.7a/mugglei.c
--- muggle-0.0.7/mugglei.c	2004-10-10 15:34:30.000000000 +0200
+++ muggle-0.0.7a/mugglei.c	2004-10-10 18:56:22.000000000 +0200
@@ -266,9 +266,9 @@
 	}
       else
 	{ // the entry does not exist, create it
-	  mgSqlWriteQuery( db,"INSERT INTO tracks (artist,title,genre1,genre2,year,"
-			   "sourceid,tracknb,mp3file,length,bitrate,samplerate,channels,genre1)"
-			   " VALUES (\"%s\", \"%s\", \"\", \"\", %d, \"%s\", %d, \"%s\", %d, \"%d\", %d, %d, %s)",
+	  mgSqlWriteQuery( db,"INSERT INTO tracks"
+			           "(artist ,title ,year ,sourceid, tracknb ,mp3file , length, bitrate, samplerate,channels,genre1,genre2)"
+			   " VALUES (\"%s\" ,\"%s\",%d   ,\"%s\"  , %d      ,\"%s\"  , %d,     \"%d\",  %d,        %d,      \"%s\",\"\")",
 			   artist.toCString(), title.toCString(), year, cddbid.toCString(),
 			   trackno, filename.c_str(), len, bitrate, sample, channels, gid.toCString() );

Probleme

Parameter

Parameter (kurz) Parameter (lang) Beschreibung
-h HHHH --host=HHHH specify database host (default is localhost)
-n NNNN --name=NNNN specify database name (overridden by -g)
-p PPPP --port=PPPP specify port of database server (default is )
-u UUUU --user=UUUU specify database user (default is )
-w WWWW --password=WWWW specify database password (default is empty)
-t TTTT --toplevel=TTTT specify toplevel directory for music (default is /mnt/music)
-g --giantdisc enable full Giantdisc compatibility mode

Links

[1] http://www.mysql.org mySQL
[2] http://www.underbit.com/products/mad (M)PEG (A)udio (D)ecoder Homepage
[3] http://www.xiph.org/ogg/vorbis Ogg Vorbis CODEC Project
[4] http://developer.kde.org/~wheeler/taglib.html Taglib - Audio Meta-Data Library
[5] http://www.htpc-tech.de/htpc/muggle.htm Homepage des Plugins