Logo: adds support for using media cover as logo source

This commit is contained in:
李通洲
2025-10-21 15:05:25 +08:00
parent 5d73cc1232
commit 338b552499
10 changed files with 75 additions and 52 deletions
+6 -2
View File
@@ -43,7 +43,7 @@ static bool artistInSongTitle(const FFstrbuf* song, const FFstrbuf* artist)
bool ffPrintMedia(FFMediaOptions* options)
{
const FFMediaResult* media = ffDetectMedia();
const FFMediaResult* media = ffDetectMedia(false);
if(media->error.length > 0)
{
@@ -128,7 +128,7 @@ void ffGenerateMediaJsonConfig(FFMediaOptions* options, yyjson_mut_doc* doc, yyj
bool ffGenerateMediaJsonResult(FF_MAYBE_UNUSED FFMediaOptions* options, yyjson_mut_doc* doc, yyjson_mut_val* module)
{
const FFMediaResult* media = ffDetectMedia();
const FFMediaResult* media = ffDetectMedia(false);
if(media->error.length > 0)
{
@@ -143,6 +143,10 @@ bool ffGenerateMediaJsonResult(FF_MAYBE_UNUSED FFMediaOptions* options, yyjson_m
yyjson_mut_obj_add_strbuf(doc, song, "artist", &media->artist);
yyjson_mut_obj_add_strbuf(doc, song, "album", &media->album);
yyjson_mut_obj_add_strbuf(doc, song, "status", &media->status);
if (media->cover.length > 0)
yyjson_mut_obj_add_strbuf(doc, song, "cover", &media->status);
else
yyjson_mut_obj_add_null(doc, song, "cover");
yyjson_mut_val* player = yyjson_mut_obj_add_obj(doc, obj, "player");
yyjson_mut_obj_add_strbuf(doc, player, "name", &media->player);
+1 -1
View File
@@ -10,7 +10,7 @@
bool ffPrintPlayer(FFPlayerOptions* options)
{
const FFMediaResult* media = ffDetectMedia();
const FFMediaResult* media = ffDetectMedia(false);
if(media->error.length > 0)
{