[Pkg-cli-apps-commits] r4143 - in /packages/tangerine/trunk/debian: changelog patches/05_add_configurable_file_types.patch

hanska-guest at users.alioth.debian.org hanska-guest at users.alioth.debian.org
Sat Sep 20 17:48:29 UTC 2008


Author: hanska-guest
Date: Sat Sep 20 17:48:29 2008
New Revision: 4143

URL: http://svn.debian.org/wsvn/pkg-cli-apps/?sc=1&rev=4143
Log:
05_add_configurable_file_types.patch added, lets the user specify
a comma-separated list of extensions to serve via the "filetypes"
configuration line. Thanks to Jo Shields (Closes: #494124)

Added:
    packages/tangerine/trunk/debian/patches/05_add_configurable_file_types.patch
Modified:
    packages/tangerine/trunk/debian/changelog

Modified: packages/tangerine/trunk/debian/changelog
URL: http://svn.debian.org/wsvn/pkg-cli-apps/packages/tangerine/trunk/debian/changelog?rev=4143&op=diff
==============================================================================
--- packages/tangerine/trunk/debian/changelog (original)
+++ packages/tangerine/trunk/debian/changelog Sat Sep 20 17:48:29 2008
@@ -5,8 +5,11 @@
     + 04_fix_music_dir_delimiter.patch added, uses "," instead of ";"
       to specify multiple directories. Thanks to Jo Shields
       (Closes: #494123)
+    + 05_add_configurable_file_types.patch added, lets the user specify
+      a comma-separated list of extensions to serve via the "filetypes"
+      configuration line. Thanks to Jo Shields (Closes: #494124)
 
- -- David Paleino <d.paleino at gmail.com>  Sat, 20 Sep 2008 19:19:30 +0200
+ -- David Paleino <d.paleino at gmail.com>  Sat, 20 Sep 2008 19:47:41 +0200
 
 tangerine (0.3.0+dfsg-2) unstable; urgency=low
 

Added: packages/tangerine/trunk/debian/patches/05_add_configurable_file_types.patch
URL: http://svn.debian.org/wsvn/pkg-cli-apps/packages/tangerine/trunk/debian/patches/05_add_configurable_file_types.patch?rev=4143&op=file
==============================================================================
--- packages/tangerine/trunk/debian/patches/05_add_configurable_file_types.patch (added)
+++ packages/tangerine/trunk/debian/patches/05_add_configurable_file_types.patch Sat Sep 20 17:48:29 2008
@@ -1,0 +1,45 @@
+See <http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=494124>
+
+Makes a new configuration line, "filetypes", containing a comma ","
+separated list of extensions to look for.
+
+Thanks to Jo Shields <directhex at apebox.org>
+--- tangerine-0.3.0+dfsg.orig/plugins/file/FilePlugin.cs
++++ tangerine-0.3.0+dfsg/plugins/file/FilePlugin.cs
+@@ -20,6 +20,7 @@
+         private DateTime lastChange = DateTime.MinValue;
+         private string[] directories;
+         private bool running = true;
++        private string[] fileTypes;
+ 
+         private IObjectContainer odb;
+ 
+@@ -38,6 +39,11 @@
+                 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;
+@@ -157,7 +163,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);
++                            }
++                        }
++                    }
+                 }
+             }
+ 




More information about the Pkg-cli-apps-commits mailing list