summaryrefslogtreecommitdiff
path: root/Utility/Quvi.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joeyh@joeyh.name>2015-05-12 13:23:22 -0400
committerGravatar Joey Hess <joeyh@joeyh.name>2015-05-12 13:23:22 -0400
commit4d49342612dd441cdc503b5294035fc05a9a5a77 (patch)
tree435a82d44b5a6aa3df411b36fb9fad2553cc670a /Utility/Quvi.hs
parent44a48a19ffeb8085e7ae1f6bf58d5661adaf8a8d (diff)
parent5cd9e10cde3c06ecc6a97f5f60a9def22f959bd2 (diff)
Merge branch 'master' into concurrentprogress
Conflicts: Command/Fsck.hs Messages.hs Remote/Directory.hs Remote/Git.hs Remote/Helper/Special.hs Types/Remote.hs debian/changelog git-annex.cabal
Diffstat (limited to 'Utility/Quvi.hs')
-rw-r--r--Utility/Quvi.hs7
1 files changed, 4 insertions, 3 deletions
diff --git a/Utility/Quvi.hs b/Utility/Quvi.hs
index 0669e7351..0412116a1 100644
--- a/Utility/Quvi.hs
+++ b/Utility/Quvi.hs
@@ -6,6 +6,7 @@
-}
{-# LANGUAGE OverloadedStrings #-}
+{-# LANGUAGE FlexibleContexts #-}
module Utility.Quvi where
@@ -30,7 +31,7 @@ data Page = Page
} deriving (Show)
data Link = Link
- { linkSuffix :: String
+ { linkSuffix :: Maybe String
, linkUrl :: URLString
} deriving (Show)
@@ -43,7 +44,7 @@ instance FromJSON Page where
instance FromJSON Link where
parseJSON (Object v) = Link
- <$> v .: "file_suffix"
+ <$> v .:? "file_suffix"
<*> v .: "url"
parseJSON _ = mzero
@@ -53,7 +54,7 @@ parseEnum s = Page
<$> get "QUVI_MEDIA_PROPERTY_TITLE"
<*> ((:[]) <$>
( Link
- <$> get "QUVI_MEDIA_STREAM_PROPERTY_CONTAINER"
+ <$> Just <$> (get "QUVI_MEDIA_STREAM_PROPERTY_CONTAINER")
<*> get "QUVI_MEDIA_STREAM_PROPERTY_URL"
)
)