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

myMPD last played API More...

#include "compile_time.h"
#include "src/mympd_api/last_played.h"
#include "dist/sds/sds.h"
#include "src/lib/json/json_print.h"
#include "src/lib/json/json_rpc.h"
#include "src/lib/sds_extras.h"
#include "src/lib/search.h"
#include "src/lib/utility.h"
#include "src/mympd_api/sticker.h"
#include "src/mympd_client/errorhandler.h"
#include "src/mympd_client/stickerdb.h"
#include "src/mympd_client/tags.h"
#include <string.h>
Include dependency graph for last_played.c:

Functions

static sds get_last_played_obj (struct t_partition_state *partition_state, struct t_stickerdb_state *stickerdb, sds buffer, unsigned entity_count, int64_t last_played, const char *uri, struct t_list *expr_list, const struct t_fields *tagcols, bool print_stickers)
 
bool mympd_api_last_played_add_song (struct t_partition_state *partition_state, unsigned last_played_count)
 
sds mympd_api_last_played_list (struct t_partition_state *partition_state, struct t_stickerdb_state *stickerdb, sds buffer, unsigned request_id, unsigned offset, unsigned limit, sds expression, const struct t_fields *tagcols)
 

Detailed Description

myMPD last played API

Function Documentation

◆ get_last_played_obj()

static sds get_last_played_obj ( struct t_partition_state partition_state,
struct t_stickerdb_state stickerdb,
sds  buffer,
unsigned  entity_count,
int64_t  last_played,
const char *  uri,
struct t_list expr_list,
const struct t_fields tagcols,
bool  print_stickers 
)
static

Private definitions

Private functions Gets the song and searches for searchstr and prints it as json object

Parameters
partition_statepointer to partition state
stickerdbpointer to stickerdb state
bufferalready allocated buffer to append the result
entity_countposition in the list
last_playedsongs last played time as unix timestamp
uriuri of the song
expr_listlist of search expressions
tagcolscolumns to print
print_stickersPrint stickers?
Returns
pointer to buffer

◆ mympd_api_last_played_add_song()

bool mympd_api_last_played_add_song ( struct t_partition_state partition_state,
unsigned  last_played_count 
)

Public functions Adds the current playing song to the last played list

Parameters
partition_statepointer to partition state
last_played_countmax songs in last_played list
Returns
true on success, else false

◆ mympd_api_last_played_list()

sds mympd_api_last_played_list ( struct t_partition_state partition_state,
struct t_stickerdb_state stickerdb,
sds  buffer,
unsigned  request_id,
unsigned  offset,
unsigned  limit,
sds  expression,
const struct t_fields tagcols 
)

Prints a jsonrpc response with the last played songs

Parameters
partition_statepointer to partition state
stickerdbpointer to stickerdb state
bufferalready allocated sds string to append the response
request_idjsonrpc request id
offsetoffset
limitmax number of entries to return
expressionmpd search expression
tagcolscolumns to print
Returns
pointer to buffer