myMPD
Internal API documentation
Loading...
Searching...
No Matches
extra_media.c File Reference

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>
Include dependency graph for extra_media.c:

Functions

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)
 

Detailed Description

Extra media files.

Function Documentation

◆ get_embedded_covers_count()

static int get_embedded_covers_count ( const char *  media_file)
static

Counts embedded images

Parameters
media_filepointer 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_filepointer to the shared mpd state
is_oggtrue 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_filepointer 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_directoryMPD music directory
booklet_namefilename for booklet
info_txt_namefilename for album info
urisong uri to get extra media for
booklet_pathpointer to already allocated sds to populate with the booklet path
info_txt_pathpointer to already allocated sds to populate with the info txt path
imagespointer to already allocated list
is_dirnametrue 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
bufferbuffer to append the jsonrpc result
mpd_statepointer to the shared mpd state
booklet_namefilename for booklet
info_txt_namefilename for album info
urisong uri to get extra media for
is_dirnametrue if uri is a directory, else false
Returns
pointer to buffer