better default collections

This commit is contained in:
Joey Hess 2013-04-26 01:46:07 -04:00
parent a86a34ae73
commit 867cba52a0

View file

@ -45,7 +45,7 @@ extractCreds i = AWS.AWSCreds (accessKeyID i) (secretAccessKey i)
- We add a few other common types, mapped to what we've been told - We add a few other common types, mapped to what we've been told
- is the closest match. - is the closest match.
-} -}
data MediaType = MediaImages | MediaAudio | MediaMovies | MediaText | MediaSoftware | MediaOmitted data MediaType = MediaImages | MediaAudio | MediaVideo | MediaText | MediaSoftware | MediaOmitted
deriving (Eq, Ord, Enum, Bounded) deriving (Eq, Ord, Enum, Bounded)
{- Format a MediaType for entry into the IA metadata -} {- Format a MediaType for entry into the IA metadata -}
@ -53,25 +53,25 @@ formatMediaType :: MediaType -> String
formatMediaType MediaText = "texts" formatMediaType MediaText = "texts"
formatMediaType MediaImages = "image" formatMediaType MediaImages = "image"
formatMediaType MediaSoftware = "software" formatMediaType MediaSoftware = "software"
formatMediaType MediaMovies = "movies" formatMediaType MediaVideo = "movies"
formatMediaType MediaAudio = "audio" formatMediaType MediaAudio = "audio"
formatMediaType MediaOmitted = "" formatMediaType MediaOmitted = ""
{- A default collection to use for each Mediatype, where one is known. -} {- A default collection to use for each Mediatype. -}
collectionMediaType :: MediaType -> Maybe String collectionMediaType :: MediaType -> Maybe String
collectionMediaType MediaText = Just "opensource" collectionMediaType MediaText = Just "opensource"
collectionMediaType MediaImages = Just "ourmedia" collectionMediaType MediaImages = Just "opensource" -- not ideal
collectionMediaType MediaSoftware = Nothing collectionMediaType MediaSoftware = Just "opensource -- not ideal
collectionMediaType MediaMovies = Just "opensource_movies" collectionMediaType MediaVideo = Just "opensource_movies"
collectionMediaType MediaAudio = Just "opensource_audio" collectionMediaType MediaAudio = Just "opensource_audio"
collectionMediaType MediaOmitted = Nothing collectionMediaType MediaOmitted = Jusr "opensource"
{- Format a MediaType for user display. -} {- Format a MediaType for user display. -}
showMediaType :: MediaType -> String showMediaType :: MediaType -> String
showMediaType MediaText = "texts" showMediaType MediaText = "texts"
showMediaType MediaImages = "photos & images" showMediaType MediaImages = "photos & images"
showMediaType MediaSoftware = "software" showMediaType MediaSoftware = "software"
showMediaType MediaMovies = "videos & movies" showMediaType MediaVideo = "videos & movies"
showMediaType MediaAudio = "audio & music" showMediaType MediaAudio = "audio & music"
showMediaType MediaOmitted = "other" showMediaType MediaOmitted = "other"