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>
Go to the source code of this file.
|
| 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_free()
| void album_cache_free |
( |
struct t_cache * |
album_cache | ) |
|
Frees the album cache
- Parameters
-
| album_cache | pointer 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_rt | Pointer 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_rt | Pointer 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_cache | pointer to t_cache struct |
| key | the 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
-
| albumkey | already allocated sds string to set the key |
| album | t_album struct |
| album_config | album 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
-
| albumkey | already allocated sds string to set the key |
| song | mpd song struct |
| album_config | album 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_cache | pointer to t_cache struct |
| workdir | myMPD working directory |
| album_config | album configuration |
- Returns
- bool true on success, else false
◆ album_cache_remove()
| bool album_cache_remove |
( |
sds |
workdir | ) |
|
Removes the album cache file
- Parameters
-
| workdir | myMPD working directory |
- Returns
- bool true on success, else false
◆ album_cache_write()
Saves the album cache to disc in mpack format
- Parameters
-
| 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 |
- Returns
- bool true on success, else false
◆ lookup_album_mode()
| const char * lookup_album_mode |
( |
enum album_modes |
mode | ) |
|
Lookups the album mode
- Parameters
-
- 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
-
- Returns
- the album mode as enum