$OpenBSD: patch-Commands_Download_hs,v 1.2 2011/05/26 08:24:59 dcoppa Exp $

fix from upstream git:
add EPID to the per-podcast command options
make renaming of mp3 files work again (gettypecommand bug)

--- Commands/Download.hs.orig	Wed Jul  2 17:32:27 2008
+++ Commands/Download.hs	Tue May 24 13:32:57 2011
@@ -42,6 +42,7 @@ import Data.ConfigFile
 import Data.String.Utils
 import Data.Either.Utils
 import Data.List
+import Data.Char
 import System.Exit
 import Control.Exception
 import Data.Progress.Tracker
@@ -259,10 +260,13 @@ procSuccess gi ep tmpfp =
                  d $ "  gettypecommand sent to stdout: " ++ show c
                  d $ "  original type was: " ++ show (eptype ep)
                  case ec of
-                   ExitSuccess -> case (strip c) of
+                   ExitSuccess -> case (stripToken c) of
                                     "" -> return (eptype ep)
                                     x -> return x
                    _ -> return (eptype ep)
+	
+          stripToken = takeWhile intoken
+              where intoken c = not $ isSpace c || c == ';'
 
           getRenameTypes =
               case getList (gcp gi) idstr "renametypes" of
@@ -284,6 +288,7 @@ procSuccess gi ep tmpfp =
                          ("FEEDURL", feedurl . podcast $ ep),
                          ("SAFECASTTITLE", sanitize_fn . castname . podcast $ ep),
                          ("SAFEEPTITLE", sanitize_fn . eptitle $ ep),
+                         ("EPID", show . epid $ ep),
                          ("EPTITLE", eptitle ep)]
 
 -- | Runs a hook script.
