myMPD
Internal API documentation
Loading...
Searching...
No Matches
cache_disk_images.h File Reference

Image cache handling. More...

#include "dist/sds/sds.h"
#include <stdbool.h>
Include dependency graph for cache_disk_images.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

sds cache_disk_images_get_basename (const char *cachedir, const char *type, const char *uri, int offset)
 
sds cache_disk_images_write_file (sds cachedir, const char *type, const char *uri, const char *mime_type, sds binary, int offset)
 

Detailed Description

Image cache handling.

Function Documentation

◆ cache_disk_images_get_basename()

sds cache_disk_images_get_basename ( const char *  cachedir,
const char *  type,
const char *  uri,
int  offset 
)

Returns the path / basename for an uri to save it in the image cache

Parameters
cachedircache directory
typeimage type
uriuri of the song for the cover
offsetnumber of the coverimage
Returns
path / basename as newly allocated sds string

◆ cache_disk_images_write_file()

sds cache_disk_images_write_file ( sds  cachedir,
const char *  type,
const char *  uri,
const char *  mime_type,
sds  binary,
int  offset 
)

Writes the image (as binary buffer) to the image cache, filename is the hash of the full path

Parameters
cachedircache directory
typeimage type
uriuri of the song for the cover
mime_typemime_type of binary buffer
binarybinary data to save
offsetnumber of the coverimage
Returns
written filename (full path) as newly allocated sds string