Extra media files.
More...
#include "compile_time.h"
#include "src/mympd_api/extra_media.h"
#include "src/lib/json/json_print.h"
#include "src/lib/log.h"
#include "src/lib/mimetype.h"
#include "src/lib/sds_extras.h"
#include "src/lib/utility.h"
#include <dirent.h>
#include <errno.h>
#include <libgen.h>
#include <string.h>
|
| static void | get_extra_files (sds music_directory, sds booklet_name, sds info_txt_name, const char *uri, sds *booklet_path, sds *info_txt_path, struct t_list *images, bool is_dirname) |
| |
| static int | get_embedded_covers_count (const char *media_file) |
| |
| static int | get_embedded_covers_count_id3 (const char *media_file) |
| |
| static int | get_embedded_covers_count_flac (const char *media_file, bool is_ogg) |
| |
| sds | mympd_api_get_extra_media (sds buffer, struct t_mpd_state *mpd_state, sds booklet_name, sds info_txt_name, const char *uri, bool is_dirname) |
| |
◆ get_embedded_covers_count()
| static int get_embedded_covers_count |
( |
const char * |
media_file | ) |
|
|
static |
Counts embedded images
- Parameters
-
| media_file | pointer to the shared mpd state |
- Returns
- image count
◆ get_embedded_covers_count_flac()
| static int get_embedded_covers_count_flac |
( |
const char * |
media_file, |
|
|
bool |
is_ogg |
|
) |
| |
|
static |
Counts embedded images for vorbis und flac files
- Parameters
-
| media_file | pointer to the shared mpd state |
| is_ogg | true if it is a ogg file, false if it is a flac file |
- Returns
- image count
◆ get_embedded_covers_count_id3()
| static int get_embedded_covers_count_id3 |
( |
const char * |
media_file | ) |
|
|
static |
Counts embedded images for id3v2 tagged files
- Parameters
-
| media_file | pointer to the shared mpd state |
- Returns
- image count
◆ get_extra_files()
| static void get_extra_files |
( |
sds |
music_directory, |
|
|
sds |
booklet_name, |
|
|
sds |
info_txt_name, |
|
|
const char * |
uri, |
|
|
sds * |
booklet_path, |
|
|
sds * |
info_txt_path, |
|
|
struct t_list * |
images, |
|
|
bool |
is_dirname |
|
) |
| |
|
static |
Private definitons
Private functions Looks for images and the booklet in the songs directory
- Parameters
-
| music_directory | MPD music directory |
| booklet_name | filename for booklet |
| info_txt_name | filename for album info |
| uri | song uri to get extra media for |
| booklet_path | pointer to already allocated sds to populate with the booklet path |
| info_txt_path | pointer to already allocated sds to populate with the info txt path |
| images | pointer to already allocated list |
| is_dirname | true if uri is a directory, else false |
◆ mympd_api_get_extra_media()
| sds mympd_api_get_extra_media |
( |
sds |
buffer, |
|
|
struct t_mpd_state * |
mpd_state, |
|
|
sds |
booklet_name, |
|
|
sds |
info_txt_name, |
|
|
const char * |
uri, |
|
|
bool |
is_dirname |
|
) |
| |
Public functions Looks for images and the booklet in the songs directory and counts the number of embedded images
- Parameters
-
| buffer | buffer to append the jsonrpc result |
| mpd_state | pointer to the shared mpd state |
| booklet_name | filename for booklet |
| info_txt_name | filename for album info |
| uri | song uri to get extra media for |
| is_dirname | true if uri is a directory, else false |
- Returns
- pointer to buffer