summaryrefslogtreecommitdiff
path: root/Command/ImportFeed.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2013-08-22 18:25:21 -0400
committerGravatar Joey Hess <joey@kitenet.net>2013-08-22 18:50:43 -0400
commitd40c7ca41b64013c76ce33e516579dbeae35744f (patch)
tree454bf4e4e52137d9a789c469829307560a8bf0d3 /Command/ImportFeed.hs
parentb485fa17ab070eaeb0501e2b249326056798f183 (diff)
Youtube support! (And 53 other video hosts)
When quvi is installed, git-annex addurl automatically uses it to detect when an page is a video, and downloads the video file. web special remote: Also support using quvi, for getting files, or checking if files exist in the web. This commit was sponsored by Mark Hepburn. Thanks!
Diffstat (limited to 'Command/ImportFeed.hs')
-rw-r--r--Command/ImportFeed.hs10
1 files changed, 2 insertions, 8 deletions
diff --git a/Command/ImportFeed.hs b/Command/ImportFeed.hs
index 5ad568647..816865e8c 100644
--- a/Command/ImportFeed.hs
+++ b/Command/ImportFeed.hs
@@ -12,7 +12,6 @@ import Text.Feed.Query
import Text.Feed.Types
import qualified Data.Set as S
import qualified Data.Map as M
-import Data.Char
import Data.Time.Clock
import Common.Annex
@@ -172,20 +171,15 @@ feedFile tmpl i = Utility.Format.format tmpl $ M.fromList
, fieldMaybe "itemdescription" $ getItemDescription $ item i
, fieldMaybe "itemrights" $ getItemRights $ item i
, fieldMaybe "itemid" $ snd <$> getItemId (item i)
- , ("extension", map sanitize $ takeExtension $ location i)
+ , ("extension", sanitizeFilePath $ takeExtension $ location i)
]
where
field k v =
- let s = map sanitize v in
+ let s = sanitizeFilePath v in
if null s then (k, "none") else (k, s)
fieldMaybe k Nothing = (k, "none")
fieldMaybe k (Just v) = field k v
- sanitize c
- | c == '.' = c
- | isSpace c || isPunctuation c || c == '/' = '_'
- | otherwise = c
-
{- Called when there is a problem with a feed.
- Throws an error if the feed is broken, otherwise shows a warning. -}
feedProblem :: URLString -> String -> Annex ()