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

Album cache. More...

#include "dist/sds/sds.h"
#include "src/lib/album.h"
#include "src/lib/cache/cache_rax.h"
#include "src/lib/fields.h"
#include <stdbool.h>
Include dependency graph for cache_rax_album.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

enum album_modes parse_album_mode (const char *mode_str)
 
const char * lookup_album_mode (enum album_modes mode)
 
bool album_cache_remove (sds workdir)
 
bool album_cache_read (struct t_cache *album_cache, sds workdir, const struct t_albums_config *album_config)
 
bool album_cache_write (struct t_cache *album_cache, sds workdir, const struct t_mympd_mpd_tags *album_tags, const struct t_albums_config *album_config, bool free_data)
 
sds album_cache_get_key_from_song (sds albumkey, const struct mpd_song *song, const struct t_albums_config *album_config)
 
sds album_cache_get_key_from_album (sds albumkey, const struct t_album *album, const struct t_albums_config *album_config)
 
struct t_albumalbum_cache_get_album (struct t_cache *album_cache, sds key)
 
void album_cache_free (struct t_cache *album_cache)
 
void album_cache_free_rt (rax *album_cache_rt)
 
void album_cache_free_rt_void (void *album_cache_rt)
 

Detailed Description

Album cache.

Function Documentation

◆ album_cache_free()

void album_cache_free ( struct t_cache album_cache)

Frees the album cache

Parameters
album_cachepointer to t_cache struct

◆ album_cache_free_rt()

void album_cache_free_rt ( rax *  album_cache_rt)

Frees the album cache radix tree

Parameters
album_cache_rtPointer to album cache radix tree

◆ album_cache_free_rt_void()

void album_cache_free_rt_void ( void *  album_cache_rt)

Frees the album cache radix tree

Parameters
album_cache_rtPointer to album cache radix tree

◆ album_cache_get_album()

struct t_album * album_cache_get_album ( struct t_cache album_cache,
sds  key 
)

Gets the album from the album cache

Parameters
album_cachepointer to t_cache struct
keythe album
Returns
mpd_song struct representing the album or NULL on error

◆ album_cache_get_key_from_album()

sds album_cache_get_key_from_album ( sds  albumkey,
const struct t_album album,
const struct t_albums_config album_config 
)

Constructs the albumkey from album struct

Parameters
albumkeyalready allocated sds string to set the key
albumt_album struct
album_configalbum configuration
Returns
pointer to changed albumkey

◆ album_cache_get_key_from_song()

sds album_cache_get_key_from_song ( sds  albumkey,
const struct mpd_song *  song,
const struct t_albums_config album_config 
)

Constructs the albumkey from song info

Parameters
albumkeyalready allocated sds string to set the key
songmpd song struct
album_configalbum configuration
Returns
pointer to changed albumkey

◆ album_cache_read()

bool album_cache_read ( struct t_cache album_cache,
sds  workdir,
const struct t_albums_config album_config 
)

Reads the album cache from disc

Parameters
album_cachepointer to t_cache struct
workdirmyMPD working directory
album_configalbum configuration
Returns
bool true on success, else false

◆ album_cache_remove()

bool album_cache_remove ( sds  workdir)

Removes the album cache file

Parameters
workdirmyMPD working directory
Returns
bool true on success, else false

◆ album_cache_write()

bool album_cache_write ( struct t_cache album_cache,
sds  workdir,
const struct t_mympd_mpd_tags album_tags,
const struct t_albums_config album_config,
bool  free_data 
)

Saves the album cache to disc in mpack format

Parameters
album_cachepointer to t_cache struct
workdirmyMPD working directory
album_tagsalbum tags to write
album_configalbum configuration
free_datatrue=free the album cache, else not
Returns
bool true on success, else false

◆ lookup_album_mode()

const char * lookup_album_mode ( enum album_modes  mode)

Lookups the album mode

Parameters
modethe album mode
Returns
album mode as string

◆ parse_album_mode()

enum album_modes parse_album_mode ( const char *  mode_str)

Public functions Parses the string to the album mode enum

Parameters
mode_strstring to parse
Returns
the album mode as enum