Permalink
Browse files

Expose /release-group/find-by-artist

  • Loading branch information...
1 parent 6117c29 commit 198f135d187e6af7cc0dca9db11e4b73f538dd20 @ocharles ocharles committed Feb 28, 2013
Showing with 10 additions and 2 deletions.
  1. +1 −1 musicbrainz-data
  2. +7 −1 src/MusicBrainz/API/ReleaseGroup.hs
  3. +1 −0 src/MusicBrainz/Service.hs
  4. +1 −0 test/suite/Handlers.hs
@@ -8,12 +8,13 @@ import Text.Digestive
import qualified Data.Set as Set
-import MusicBrainz
+import MusicBrainz hiding (coreRef)
import MusicBrainz.API
import MusicBrainz.API.JSON
import qualified MusicBrainz.API.Common as Common
import qualified MusicBrainz.Data as MB
+import qualified MusicBrainz.Data.ReleaseGroup as MB
--------------------------------------------------------------------------------
tree :: Form Text MusicBrainz (Tree ReleaseGroup)
@@ -66,3 +67,8 @@ getRevision = Common.getRevision
--------------------------------------------------------------------------------
findLatest :: Form Text MusicBrainz (MaybeObject (CoreEntity ReleaseGroup))
findLatest = Common.findLatest
+
+
+--------------------------------------------------------------------------------
+findByArtist :: Form Text MusicBrainz [CoreEntity ReleaseGroup]
+findByArtist = runApi $ MB.findByArtist <$> "artist" .: coreRef
@@ -297,6 +297,7 @@ serviceInit connInfo sessionStore =
, ("/release/view-revision", expose Release.viewRevision)
, ("/release-group/create", expose ReleaseGroup.create)
+ , ("/release-group/find-by-artist", expose ReleaseGroup.findByArtist)
, ("/release-group/find-latest", expose ReleaseGroup.findLatest)
, ("/release-group/get-revision", expose ReleaseGroup.getRevision)
, ("/release-group/merge", expose ReleaseGroup.merge)
View
@@ -69,6 +69,7 @@ tests = map testHandlerExists
, "/release/view-release-labels"
, "/release/view-revision"
, "/release-group/create"
+ , "/release-group/find-by-artist"
, "/release-group/find-latest"
, "/release-group/get-revision"
, "/release-group/merge"

0 comments on commit 198f135

Please sign in to comment.