|
myMPD
Internal API documentation
|
Album cache. More...
#include "compile_time.h"#include "src/lib/cache/cache_rax_album.h"#include "dist/mpack/mpack.h"#include "dist/rax/rax.h"#include "src/lib/album.h"#include "src/lib/filehandler.h"#include "src/lib/log.h"#include "src/lib/mem.h"#include "src/lib/mpack.h"#include "src/lib/sds_extras.h"#include "src/lib/utility.h"#include "src/mympd_client/tags.h"#include <errno.h>#include <inttypes.h>#include <stdio.h>#include <string.h>
Enumerations | |
| enum | { ALBUM_CACHE_VERSION = 1 } |
Functions | |
| static struct t_album * | album_from_mpack_node (mpack_node_t album_node, const struct t_mympd_mpd_tags *tags, sds *key, const struct t_albums_config *album_config) |
| 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_album * | album_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) |
Album cache.
| anonymous enum |
Private definitions
| void album_cache_free | ( | struct t_cache * | album_cache | ) |
Frees the album cache
| album_cache | pointer to t_cache struct |
| void album_cache_free_rt | ( | rax * | album_cache_rt | ) |
Frees the album cache radix tree
| album_cache_rt | Pointer to album cache radix tree |
| void album_cache_free_rt_void | ( | void * | album_cache_rt | ) |
Frees the album cache radix tree
| album_cache_rt | Pointer to album cache radix tree |
Gets the album from the album cache
| album_cache | pointer to t_cache struct |
| key | the 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
| albumkey | already allocated sds string to set the key |
| album | t_album struct |
| album_config | album configuration |
| 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
| albumkey | already allocated sds string to set the key |
| song | mpd song struct |
| album_config | album configuration |
| bool album_cache_read | ( | struct t_cache * | album_cache, |
| sds | workdir, | ||
| const struct t_albums_config * | album_config | ||
| ) |
Reads the album cache from disc
| album_cache | pointer to t_cache struct |
| workdir | myMPD working directory |
| album_config | album configuration |
| bool album_cache_remove | ( | sds | workdir | ) |
Removes the album cache file
| workdir | myMPD working directory |
| 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
| album_cache | pointer to t_cache struct |
| workdir | myMPD working directory |
| album_tags | album tags to write |
| album_config | album configuration |
| free_data | true=free the album cache, else not |
|
static |
Private functions Creates a mpd_song struct from cache
| album_node | mpack node to parse |
| tags | tags to read |
| key | already allocated sds string to set the album key |
| album_config | album configuration |
| const char * lookup_album_mode | ( | enum album_modes | mode | ) |
Lookups the album mode
| mode | the album mode |
| enum album_modes parse_album_mode | ( | const char * | mode_str | ) |
Public functions Parses the string to the album mode enum
| mode_str | string to parse |