themoviedb 1.0.0.0 → 1.1.0.0
raw patch · 13 files changed
+106/−29 lines, 13 filesdep +time-locale-compatdep −networkdep −network-uridep −old-localedep ~aesondep ~bytestringdep ~mtlPVP ok
version bump matches the API change (PVP)
Dependencies added: time-locale-compat
Dependencies removed: network, network-uri, old-locale, unix
Dependency ranges changed: aeson, bytestring, mtl, transformers
API changes (from Hackage documentation)
+ Network.API.TheMovieDB.Types.Episode: instance Ord Episode
+ Network.API.TheMovieDB.Types.Season: instance Ord Season
+ Network.API.TheMovieDB.Types.TV: instance Ord TV
Files
- CHANGES +6/−0
- example/Main.hs +1/−1
- src/Network/API/TheMovieDB/Actions.hs +6/−0
- src/Network/API/TheMovieDB/Internal/Date.hs +3/−2
- src/Network/API/TheMovieDB/Internal/HTTP.hs +6/−0
- src/Network/API/TheMovieDB/Internal/TheMovieDB.hs +6/−0
- src/Network/API/TheMovieDB/Types/Episode.hs +11/−0
- src/Network/API/TheMovieDB/Types/Genre.hs +6/−0
- src/Network/API/TheMovieDB/Types/Movie.hs +6/−0
- src/Network/API/TheMovieDB/Types/Season.hs +10/−0
- src/Network/API/TheMovieDB/Types/TV.hs +10/−0
- test/TestHelper.hs +6/−0
- themoviedb.cabal +29/−26
CHANGES view
@@ -2,6 +2,12 @@ #+title: Version History #+startup: showall +* 1.1.0.0 (May 22, 2015)++ - Added Ord instance for TV, Season, and Episode+ - Removed unused dependencies from build-depends+ - Changes to build with GHC 7.8.4. and 7.10.1+ * 1.0.0.0 (April 5, 2015) - Major rewrite of the interface
example/Main.hs view
@@ -20,10 +20,10 @@ import Data.Text (Text) import qualified Data.Text as T import Data.Time (formatTime)+import Data.Time.Locale.Compat (defaultTimeLocale) import Network.API.TheMovieDB import System.Environment (getArgs) import System.Exit (exitFailure, exitSuccess)-import System.Locale (defaultTimeLocale) import Text.Printf (printf) --------------------------------------------------------------------------------
src/Network/API/TheMovieDB/Actions.hs view
@@ -34,6 +34,12 @@ import Network.API.TheMovieDB.Types.TV --------------------------------------------------------------------------------+-- The following is a kludge to avoid the "redundant import" warning+-- when using GHC >= 7.10.x. This should be removed after we decide+-- to stop supporting GHC < 7.10.x.+import Prelude++-------------------------------------------------------------------------------- -- | Search TheMovieDB using the given query string. -- -- The movies returned will not have all their fields completely
src/Network/API/TheMovieDB/Internal/Date.hs view
@@ -1,3 +1,4 @@+{-# OPTIONS_GHC -Wwarn #-} -- Kludge to not error out on parseTime deprecation. {-# LANGUAGE OverloadedStrings #-} {-@@ -25,8 +26,8 @@ import Data.Aeson.Types (Parser, typeMismatch) import Data.Text (Text) import qualified Data.Text as T-import Data.Time (parseTime, Day(..))-import System.Locale (defaultTimeLocale)+import Data.Time (Day(..), parseTime)+import Data.Time.Locale.Compat (defaultTimeLocale) -------------------------------------------------------------------------------- -- | A simple type wrapper around 'Day' in order to parse a movie's
src/Network/API/TheMovieDB/Internal/HTTP.hs view
@@ -25,6 +25,12 @@ import Network.HTTP.Types --------------------------------------------------------------------------------+-- The following is a kludge to avoid the "redundant import" warning+-- when using GHC >= 7.10.x. This should be removed after we decide+-- to stop supporting GHC < 7.10.x.+import Prelude++-------------------------------------------------------------------------------- -- | The base URL for the version of the API we're using. apiBaseURL :: String apiBaseURL = "https://api.themoviedb.org/3/"
src/Network/API/TheMovieDB/Internal/TheMovieDB.hs view
@@ -34,6 +34,12 @@ import Network.HTTP.Types --------------------------------------------------------------------------------+-- The following is a kludge to avoid the "redundant import" warning+-- when using GHC >= 7.10.x. This should be removed after we decide+-- to stop supporting GHC < 7.10.x.+import Prelude++-------------------------------------------------------------------------------- -- | The type for functions that make requests to the API (or pretend -- to make a request for testing purposes). type RequestFunction = (Path -> QueryText -> IO (Either Error Body))
src/Network/API/TheMovieDB/Types/Episode.hs view
@@ -28,6 +28,12 @@ import Network.API.TheMovieDB.Internal.Types --------------------------------------------------------------------------------+-- The following is a kludge to avoid the "redundant import" warning+-- when using GHC >= 7.10.x. This should be removed after we decide+-- to stop supporting GHC < 7.10.x.+import Prelude++-------------------------------------------------------------------------------- -- | Metadata for a TV Episode. -- -- * The 'episodeStillPath' field is an incomplete URL. To@@ -57,6 +63,11 @@ -- 'episodeStillURLs' function for more information. } deriving (Eq, Show)++--------------------------------------------------------------------------------+instance Ord Episode where+ compare a b = compare (episodeSeasonNumber a, episodeNumber a)+ (episodeSeasonNumber b, episodeNumber b) -------------------------------------------------------------------------------- instance FromJSON Episode where
src/Network/API/TheMovieDB/Types/Genre.hs view
@@ -24,6 +24,12 @@ import Network.API.TheMovieDB.Internal.Types --------------------------------------------------------------------------------+-- The following is a kludge to avoid the "redundant import" warning+-- when using GHC >= 7.10.x. This should be removed after we decide+-- to stop supporting GHC < 7.10.x.+import Prelude++-------------------------------------------------------------------------------- -- | Metadata for a genre. data Genre = Genre { genreID :: ItemID -- ^ TheMovieDB unique ID.
src/Network/API/TheMovieDB/Types/Movie.hs view
@@ -29,6 +29,12 @@ import Network.API.TheMovieDB.Types.Genre --------------------------------------------------------------------------------+-- The following is a kludge to avoid the "redundant import" warning+-- when using GHC >= 7.10.x. This should be removed after we decide+-- to stop supporting GHC < 7.10.x.+import Prelude++-------------------------------------------------------------------------------- -- | Metadata for a movie. -- -- * The 'moviePosterPath' field is an incomplete URL. To construct
src/Network/API/TheMovieDB/Types/Season.hs view
@@ -29,6 +29,12 @@ import Network.API.TheMovieDB.Types.Episode --------------------------------------------------------------------------------+-- The following is a kludge to avoid the "redundant import" warning+-- when using GHC >= 7.10.x. This should be removed after we decide+-- to stop supporting GHC < 7.10.x.+import Prelude++-------------------------------------------------------------------------------- -- | Metadata for a TV Season. -- -- * The 'seasonPosterPath' field is an incomplete URL. To@@ -55,6 +61,10 @@ -- ^ List of 'Episode's. } deriving (Eq, Show)++--------------------------------------------------------------------------------+instance Ord Season where+ compare a b = seasonNumber a `compare` seasonNumber b -------------------------------------------------------------------------------- instance FromJSON Season where
src/Network/API/TheMovieDB/Types/TV.hs view
@@ -30,6 +30,12 @@ import Network.API.TheMovieDB.Types.Season --------------------------------------------------------------------------------+-- The following is a kludge to avoid the "redundant import" warning+-- when using GHC >= 7.10.x. This should be removed after we decide+-- to stop supporting GHC < 7.10.x.+import Prelude++-------------------------------------------------------------------------------- -- | Metadata for a TV series. -- -- * The 'tvPosterPath' field is an incomplete URL. To construct a@@ -76,6 +82,10 @@ -- be season 1. } deriving (Eq, Show)++--------------------------------------------------------------------------------+instance Ord TV where+ compare a b = tvID a `compare` tvID b -------------------------------------------------------------------------------- instance FromJSON TV where
test/TestHelper.hs view
@@ -15,6 +15,12 @@ import Test.Tasty.HUnit --------------------------------------------------------------------------------+-- The following is a kludge to avoid the "redundant import" warning+-- when using GHC >= 7.10.x. This should be removed after we decide+-- to stop supporting GHC < 7.10.x.+import Prelude++-------------------------------------------------------------------------------- fakeTMDB :: FilePath -> TheMovieDB a -> IO a fakeTMDB path m = do result <- runTheMovieDBWithRequestFunction (fileRequest path) m
themoviedb.cabal view
@@ -1,6 +1,6 @@ -------------------------------------------------------------------------------- name: themoviedb-version: 1.0.0.0+version: 1.1.0.0 synopsis: Haskell API bindings for http://themoviedb.org homepage: http://github.com/pjones/themoviedb bug-reports: http://github.com/pjones/themoviedb/issues@@ -11,7 +11,7 @@ copyright: Copyright: (c) 2012-2015 Peter Jones category: Network, API stability: experimental-tested-with: GHC == 7.8.4+tested-with: GHC == 7.8.4, GHC == 7.10.1 build-type: Simple cabal-version: >=1.10 description: This library provides functions for retrieving metadata@@ -56,28 +56,25 @@ default-language: Haskell2010 hs-source-dirs: src ghc-options: -Wall -fwarn-incomplete-uni-patterns- ghc-prof-options: -prof -auto-all if flag(maintainer) ghc-options: -Werror+ ghc-prof-options: -prof -auto-all - build-depends: aeson >= 0.6 && < 0.9- , base >= 4.6 && < 5.0- , binary >= 0.7 && < 0.8- , bytestring >= 0.9 && < 0.11- , either >= 4.3 && < 4.4- , http-client >= 0.4 && < 0.5- , http-client-tls >= 0.2.2 && < 0.3- , http-types >= 0.8 && < 0.9- , mtl >= 2.1 && < 2.2- , network >= 2.3 && < 2.7- , network-uri >= 2.6 && < 2.7- , old-locale >= 1.0 && < 1.1- , text >= 0.11 && < 1.3- , text-binary >= 0.1 && < 0.2- , time >= 1.2 && < 1.6- , transformers >= 0.3 && < 0.5- , unix >= 2.5 && < 2.8+ build-depends: aeson >= 0.6 && < 0.9+ , base >= 4.6 && < 5.0+ , binary >= 0.7 && < 0.8+ , bytestring >= 0.9 && < 0.11+ , either >= 4.3 && < 4.4+ , http-client >= 0.4 && < 0.5+ , http-client-tls >= 0.2.2 && < 0.3+ , http-types >= 0.8 && < 0.9+ , mtl >= 2.1 && < 2.3+ , text >= 0.11 && < 1.3+ , text-binary >= 0.1 && < 0.2+ , time >= 1.2 && < 1.6+ , time-locale-compat >= 0.1 && < 0.2+ , transformers >= 0.3 && < 0.5 -------------------------------------------------------------------------------- executable tmdb@@ -90,9 +87,12 @@ if flag(maintainer) ghc-options: -Werror - build-depends: themoviedb, base, unix, old-locale, time,- text, aeson, network, bytestring, transformers-+ build-depends: base+ , text+ , themoviedb+ , time+ , time-locale-compat+ , transformers -------------------------------------------------------------------------------- test-suite test@@ -107,7 +107,10 @@ if flag(maintainer) ghc-options: -Werror - build-depends: tasty >= 0.10 && < 0.11+ build-depends: base+ , bytestring+ , tasty >= 0.10 && < 0.11 , tasty-hunit >= 0.9 && < 0.10- , themoviedb, base, unix, old-locale, time- , text, aeson, network, bytestring, transformers+ , text+ , themoviedb+ , time