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

Albumart functions. More...

#include "compile_time.h"
#include "src/webserver/albumart.h"
#include "src/lib/api.h"
#include "src/lib/cache/cache_disk.h"
#include "src/lib/convert.h"
#include "src/lib/filehandler.h"
#include "src/lib/json/json_print.h"
#include "src/lib/json/json_query.h"
#include "src/lib/json/json_rpc.h"
#include "src/lib/log.h"
#include "src/lib/mimetype.h"
#include "src/lib/msg_queue.h"
#include "src/lib/sds_extras.h"
#include "src/lib/utility.h"
#include "src/lib/validate.h"
#include "src/webserver/placeholder.h"
#include "src/webserver/webradio.h"
#include <libgen.h>
Include dependency graph for albumart.c:

Functions

static bool handle_coverextract (struct mg_connection *nc, sds cachedir, const char *uri, const char *media_file, bool covercache, int offset)
 
void webserver_send_albumart_redirect (struct mg_connection *nc, sds data)
 
void webserver_send_albumart (struct mg_connection *nc, sds data, sds binary)
 
void request_handler_albumart_by_album_id (struct mg_http_message *hm, unsigned long conn_id, enum albumart_sizes size)
 
bool request_handler_albumart_by_uri (struct mg_connection *nc, struct mg_http_message *hm, struct t_mg_user_data *mg_user_data, unsigned long conn_id, enum albumart_sizes size)
 

Detailed Description

Albumart functions.

Function Documentation

◆ handle_coverextract()

static bool handle_coverextract ( struct mg_connection *  nc,
sds  cachedir,
const char *  uri,
const char *  media_file,
bool  covercache,
int  offset 
)
static

Privat definitions

Extracts albumart from media files

Parameters
ncmongoose connection
cachedircovercache directory
urisong uri
media_filefull path to the song
covercachetrue = covercache is enabled
offsetnumber of embedded image to extract
Returns
true on success, else false

◆ request_handler_albumart_by_album_id()

void request_handler_albumart_by_album_id ( struct mg_http_message *  hm,
unsigned long  conn_id,
enum albumart_sizes  size 
)

Request handler for /albumart/albumid and /albumart-thumb/albumid. Sends the request to the mympd_api thread.

Parameters
hmhttp message
conn_idconnection id
sizesize of the albumart

◆ request_handler_albumart_by_uri()

bool request_handler_albumart_by_uri ( struct mg_connection *  nc,
struct mg_http_message *  hm,
struct t_mg_user_data mg_user_data,
unsigned long  conn_id,
enum albumart_sizes  size 
)

Request handler for /albumart and /albumart-thumb

Parameters
ncmongoose connection
hmhttp message
mg_user_datapointer to mongoose configuration
conn_idconnection id
sizealbumart size
Returns
true: an image was served, false: request was sent to the mympd_api thread to get the image by MPD

◆ webserver_send_albumart()

void webserver_send_albumart ( struct mg_connection *  nc,
sds  data,
sds  binary 
)

Sends the albumart response from mpd to the client

Parameters
ncmongoose connection
datajsonrpc response
binarythe image

◆ webserver_send_albumart_redirect()

void webserver_send_albumart_redirect ( struct mg_connection *  nc,
sds  data 
)

Public functions Sends the albumart redirect response from the albumart_by_albumid handler

Parameters
ncmongoose connection
datajsonrpc response