Wishlist: allow user to set file extensions to serve
Jo Shields
directhex at apebox.org
Thu Aug 7 11:25:39 UTC 2008
Package: tangerine
Version: 0.3.0+dfsg-2~dhx2
Severity: wishlist
Tags: patch
Tangerine does a very good job of serving files over daap, and is
significantly more reliable than the more common mt-daapd. However, one visible
difference between the two is the number of files offered - on my music
collection Tangerine offers about 500 files more than mt-daapd. This is caused
by Tangerine's policy of serving ALL files it can - so if your music folder
contains any album art, then those album art files are offered up as invalid
music files.
My attached patch allows a user to configure an extra config line in their
~/.tangerine, specifying which file extensions are permitted. The default
behaviour is to serve all files - the new behaviour requires specific
enabling in the config file.
The attached images show a small music collection being served as standard,
and being served by a patched Tangerine with the following stanza added to
~/.tangerine:
filetypes = .ogg,.mp3
Multiply the effect by a few hundred albums, and the effect is striking.
-- System Information:
Debian Release: lenny/sid
APT prefers hardy-updates
APT policy: (500, 'hardy-updates'), (500, 'hardy-security'), (500, 'hardy-backports'), (500, 'hardy')
Architecture: amd64 (x86_64)
Kernel: Linux 2.6.24-19-rt (SMP w/2 CPU cores; PREEMPT)
Locale: LANG=en_GB.UTF-8, LC_CTYPE=en_GB.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Versions of packages tangerine depends on:
ii libavahi1.0-cil 0.6.19-1 CLI bindings for Avahi
ii libc6 2.7-10ubuntu3 GNU C Library: Shared libraries
ii libdb4o6.0-cil 6.1.604+dfsg-2 native OODBMS for CLI
ii libexif12 0.6.16-2.1 library to parse EXIF files
ii libglade2.0-cil 2.12.0-2ubuntu3 CLI binding for the Glade librarie
ii libglib2.0-0 2.16.4-0ubuntu2 The GLib library of C routines
ii libglib2.0-cil 2.12.0-2ubuntu3 CLI binding for the GLib utility l
ii libgtk2.0-0 2.12.9-3ubuntu4 The GTK+ graphical user interface
ii libgtk2.0-cil 2.12.0-2ubuntu3 CLI binding for the GTK+ toolkit 2
ii liblog4net1.2-c 1.2.9beta-0ubuntu3 highly configurable logging API fo
ii libmono-corlib2 1.9.1+dfsg-2ubuntu2~dhx1 Mono core library (2.0)
ii libmono-sharpzi 1.9.1+dfsg-2ubuntu2~dhx1 Mono SharpZipLib library
ii libmono-sqlite2 1.9.1+dfsg-2ubuntu2~dhx1 Mono Sqlite library
ii libmono-system- 1.9.1+dfsg-2ubuntu2~dhx1 Mono System.Data Library
ii libmono-system- 1.9.1+dfsg-2ubuntu2~dhx1 Mono System.Web Library
ii libmono-system2 1.9.1+dfsg-2ubuntu2~dhx1 Mono System libraries (2.0)
ii libmono2.0-cil 1.9.1+dfsg-2ubuntu2~dhx1 Mono libraries (2.0)
ii libndesk-dbus1. 0.6.0-1 CLI implementation of D-Bus
ii libnini1.1-cil 1.1.0+dfsg-2 CLI library for managing configura
ii libsm6 2:1.0.3-1 X11 Session Management library
ii libtaglib2.0-ci 2.0.3.0-1 CLI library for accessing audio an
ii mono-runtime 1.9.1+dfsg-2ubuntu2~dhx1 Mono runtime
tangerine recommends no packages.
-- no debconf information
-------------- next part --------------
diff -urNad tangerine-0.3.0+dfsg~/plugins/file/FilePlugin.cs tangerine-0.3.0+dfsg/plugins/file/FilePlugin.cs
--- tangerine-0.3.0+dfsg~/plugins/file/FilePlugin.cs 2008-08-07 11:59:14.000000000 +0100
+++ tangerine-0.3.0+dfsg/plugins/file/FilePlugin.cs 2008-08-07 11:48:03.000000000 +0100
@@ -20,6 +20,7 @@
private DateTime lastChange = DateTime.MinValue;
private string[] directories;
private bool running = true;
+ private string[] fileTypes;
private ObjectContainer odb;
@@ -38,6 +32,10 @@
directories = new string[] { defaultDir };
} else {
directories = Daemon.ConfigSource.Configs["FilePlugin"].Get ("directories", defaultDir).Split (',');
+ fileTypes = Daemon.ConfigSource.Configs["FilePlugin"].Get ("filetypes", String.Empty).Split (',');
+ if (fileTypes[0] == String.Empty) {
+ fileTypes = new string[] {};
+ }
}
server = Daemon.Server;
@@ -156,7 +161,15 @@
if (Path.GetExtension (file) == ".m3u") {
playlistFiles.Add (file);
} else {
- AddTrack (file);
+ if (fileTypes.Length == 0) {
+ AddTrack (file);
+ } else {
+ foreach (string extension in fileTypes) {
+ if (Path.GetExtension (file) == extension) {
+ AddTrack (file);
+ }
+ }
+ }
}
}
-------------- next part --------------
A non-text attachment was scrubbed...
Name: tangerine-current.png
Type: image/png
Size: 106836 bytes
Desc: not available
URL: <https://lists.ubuntu.com/archives/ubuntu-users/attachments/20080807/10c5f2e8/attachment.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: tangerine-patched.png
Type: image/png
Size: 98014 bytes
Desc: not available
URL: <https://lists.ubuntu.com/archives/ubuntu-users/attachments/20080807/10c5f2e8/attachment-0001.png>
More information about the ubuntu-users
mailing list