vimus / libmpd-haskell

A client library for MPD, the Music Player Daemon
MIT License
36 stars 26 forks source link

libmpd v0.10 #134

Closed iyefrat closed 3 years ago

iyefrat commented 3 years ago

Hi! I've bunched up all the breaking changes I want to make in the foreseeable future (and a few nonbreaking ones). I've added migration instructions in the changlog and the changes are all easy fixes. Details below:

Require MPD 0.19

MPD 0.19 came out like 7 years ago, and from repology it looks like the operating systems that have versions older than that are either incredibly niche or very old LTS systems, which will probably not be installing up to date haskell packages anyway.

The practical reasons for doing this are because the change to list in the next section requires it, and also it is easier to locally recompile newer versions of MPD for testing purposes.

list now takes a general Query

This reflects the behaviour changes in the MPD "list" command in 0.19, and makes the command much more powerful. Wanting to have this in my client kind of instigated this whole version bump.

(Position,Position) has been replaces with Range

The Range datatype is defined as such:

-- | A range of songs in a playlist.
--
-- @since 0.10.0.0
data Range
  = Range Position Position -- ^ Start and end of the range, not including the end position.
  | Start Position -- ^ From the given position until the end of the playlist.
  deriving (Eq, Show)

This adds support for partial ranges (things like "3:" in the MPD protocol).

Missing constructors

I have added the following:

I've also fixed the idle command to recognize all subsystems, it was missing a few.

Promote toggle to a protocol implementation.

The MPD command "pause" has toggled the playback state since basically forever, but has been deprecated for reasons that have been lost to time. I brought this up with MPD's maintainer a while back and he undeprecated it. Personally I wanted to change the type of pause from Bool -> m () to Maybe Bool -> m () to reflect the fact that the MPD command can get "pause", "pause 0", and "pause 1", but I tried to limit breaking compatibility to what's absolutely necessary, so I moved toggle from the Extensions module to the PlaybackControl module.

Remove deprecated functions

I've Removed (<&>), updateId, addList, and playlistAddList.

Move CI to github actions

Recently travis CI has been taking a very long time to actually run, so I moved the CI over to github actions. I also updated the tested GHC to 8.10.3 and the stack resolver to 16.

Edit: originally I also removed the travis CI, but that caused it not to run on this PR, so I added it back for now.

Don't fail if single is set to oneshot

This is kind of an odd feature of the MPD protocol, and given the fact that it seems to not really be used anywhere (ncmpcpp and mpc don't support it), and that representing it as a type is a pretty ugly, the parser now interprets "single: oneshot" as stSingle = True instead of erroring out.

iyefrat commented 3 years ago

I also added the date on the changelog, assuming this is good to go

psibi commented 3 years ago

Thank you!

iyefrat commented 3 years ago

@psibi Thanks! Can you make the release on hackage as well please?

psibi commented 3 years ago

@iyefrat Done!