{-# LANGUAGE NoImplicitPrelude #-} module Bamboo.Model.Video where -- env import Bamboo.Helper.Env hiding (title, body, size, path, meta, get, width, height) import qualified Bamboo.Config.Global as G import Bamboo.Helper.StateHelper data VideoType = MediaPlayer deriving (Eq, Show, Read) instance Default VideoType where def = MediaPlayer data Video = Video { uid :: String -- album/08-06-10 , preview :: String , width :: Int , height :: Int , video_type :: VideoType } deriving (Show, Eq) instance Resource Video where resource_title = uid > spaced_url data VideoData = Link | Preview | Width | Height | Type deriving (Show) from_list xs = Video { uid = at Link , preview = at' Preview "" , width = at' Width "400" .read , height = at' Height "300" .read , video_type = at' Type "media_player" .camel_case.read } .return where at x = xs.lookup (x.show_data).fromJust at' x d = xs.lookup (x .show_data) .fromMaybe d