myMPD
Internal API documentation
Loading...
Searching...
No Matches
albums.c File Reference

myMPD browse database API More...

#include "compile_time.h"
#include "src/mympd_api/albums.h"
#include "src/lib/album.h"
#include "src/lib/cache/cache_rax_album.h"
#include "src/lib/fields.h"
#include "src/lib/json/json_print.h"
#include "src/lib/json/json_rpc.h"
#include "src/lib/log.h"
#include "src/lib/rax_extras.h"
#include "src/lib/sds_extras.h"
#include "src/lib/search.h"
#include "src/lib/sticker.h"
#include "src/mympd_api/extra_media.h"
#include "src/mympd_api/sticker.h"
#include "src/mympd_client/errorhandler.h"
#include "src/mympd_client/search.h"
#include "src/mympd_client/stickerdb.h"
#include "src/mympd_client/tags.h"
#include <string.h>
Include dependency graph for albums.c:

Functions

static sds get_sort_key_album (sds key, enum sort_by_type sort_by, enum mpd_tag_type sort_tag, const struct t_album *album)
 
static bool check_album_sort_tag (enum sort_by_type sort_by, enum mpd_tag_type sort_tag, struct t_albums_config *album_config)
 
sds mympd_api_album_detail (struct t_mympd_state *mympd_state, struct t_partition_state *partition_state, sds buffer, unsigned request_id, sds albumid, const struct t_fields *tagcols)
 
sds mympd_api_album_list (struct t_mympd_state *mympd_state, struct t_partition_state *partition_state, sds buffer, unsigned request_id, sds expression, sds sort, bool sortdesc, unsigned offset, unsigned limit, const struct t_fields *tagcols)
 

Detailed Description

myMPD browse database API

Function Documentation

◆ check_album_sort_tag()

static bool check_album_sort_tag ( enum sort_by_type  sort_by,
enum mpd_tag_type  sort_tag,
struct t_albums_config album_config 
)
static

Validates the album sort tag

Parameters
sort_bysort by type
sort_tagsort tag
album_configpointer to album config
Returns
true on valid tag, else false

◆ get_sort_key_album()

static sds get_sort_key_album ( sds  key,
enum sort_by_type  sort_by,
enum mpd_tag_type  sort_tag,
const struct t_album album 
)
static

Gets an alphanumeric string for sorting

Parameters
keyalready allocated sds string to append
sort_byenum sort_by
sort_tagmpd tag to sort by
albumpointer to t_album
Returns
pointer to key

◆ mympd_api_album_detail()

sds mympd_api_album_detail ( struct t_mympd_state mympd_state,
struct t_partition_state partition_state,
sds  buffer,
unsigned  request_id,
sds  albumid,
const struct t_fields tagcols 
)

Lists album details

Parameters
mympd_statepointer to mympd state
partition_statepointer to partition specific states
buffersds string to append response
request_idjsonrpc request id
albumidid of the album (key in the album_cache)
tagcolst_fields struct of song tags to print
Returns
pointer to buffer

◆ mympd_api_album_list()

sds mympd_api_album_list ( struct t_mympd_state mympd_state,
struct t_partition_state partition_state,
sds  buffer,
unsigned  request_id,
sds  expression,
sds  sort,
bool  sortdesc,
unsigned  offset,
unsigned  limit,
const struct t_fields tagcols 
)

Lists albums from the album_cache

Parameters
mympd_statepointer to mympd_state
partition_statepointer to partition specific states
buffersds string to append response
request_idjsonrpc request id
expressionmpd search expression
sorttag to sort the result
sortdesctrue to sort descending, false to sort ascending
offsetoffset of results to print
limitmax number of results to print
tagcolstags to print
Returns
pointer to buffer