mpd v0.1.0 Mpd.Songs View Source

This module is used to manipulate multiple songs like filtering or find songs among a list.

Link to this section Summary

Functions

Groups a list of songs by album

Groups a list of songs by artist

Creates a tree from songs grouped by artist then album.

Filters a list of songs by a given Artist tag insensitively

Filters a list of songs by a given Artist tag insensitively

Filters a list of songs by a given tag insensitively

Parses a song list MPD output into structs

Link to this section Types

Specs

song_map() :: %{required(binary()) => songs()}

Specs

song_tree() :: %{required(binary()) => song_map()}

Specs

songs() :: [Mpd.Song.t()]

Link to this section Functions

Specs

albums(songs()) :: song_map()

Groups a list of songs by album

Specs

artists(songs()) :: song_map()

Groups a list of songs by artist

Specs

as_tree(songs() | song_map()) :: song_tree()

Creates a tree from songs grouped by artist then album.

%{
  "Rouge Pompier" => %{
    "Neve Campbell" => [
      %Mpd.Song{},
      %Mpd.Song{},
    ],
    "Kevin Bacon" => [
      %Mpd.Song{},
      %Mpd.Song{},
    ]
  }
}
Link to this function

find_by_album(songs, value)

View Source

Specs

find_by_album(songs(), binary()) :: songs()

Filters a list of songs by a given Artist tag insensitively

Link to this function

find_by_artist(songs, value)

View Source

Specs

find_by_artist(songs(), binary()) :: songs()

Filters a list of songs by a given Artist tag insensitively

Link to this function

find_by_tag(songs, tag, value)

View Source

Specs

find_by_tag(songs(), binary(), binary()) :: songs()

Filters a list of songs by a given tag insensitively

Specs

parse(binary()) :: songs()

Parses a song list MPD output into structs