mirror of
https://github.com/owntone/owntone-server.git
synced 2025-01-13 16:03:23 -05:00
[artwork] Let the artwork handler for streams use queue->artwork_url instead of calling the player, which was messy
This commit is contained in:
parent
4d4a4ffd70
commit
2696b27972
@ -40,7 +40,6 @@
|
|||||||
#include "logger.h"
|
#include "logger.h"
|
||||||
#include "conffile.h"
|
#include "conffile.h"
|
||||||
#include "cache.h"
|
#include "cache.h"
|
||||||
#include "player.h"
|
|
||||||
#include "http.h"
|
#include "http.h"
|
||||||
|
|
||||||
#include "avio_evbuffer.h"
|
#include "avio_evbuffer.h"
|
||||||
@ -1105,6 +1104,7 @@ static int
|
|||||||
source_item_stream_get(struct artwork_ctx *ctx)
|
source_item_stream_get(struct artwork_ctx *ctx)
|
||||||
{
|
{
|
||||||
struct http_client_ctx client;
|
struct http_client_ctx client;
|
||||||
|
struct db_queue_item *queue_item;
|
||||||
struct keyval *kv;
|
struct keyval *kv;
|
||||||
const char *content_type;
|
const char *content_type;
|
||||||
char *url;
|
char *url;
|
||||||
@ -1116,9 +1116,15 @@ source_item_stream_get(struct artwork_ctx *ctx)
|
|||||||
|
|
||||||
ret = ART_E_NONE;
|
ret = ART_E_NONE;
|
||||||
|
|
||||||
url = player_get_icy_artwork_url(ctx->id);
|
queue_item = db_queue_fetch_byfileid(ctx->id);
|
||||||
if (!url)
|
if (!queue_item || !queue_item->artwork_url)
|
||||||
|
{
|
||||||
|
free_queue_item(queue_item, 0);
|
||||||
return ART_E_NONE;
|
return ART_E_NONE;
|
||||||
|
}
|
||||||
|
|
||||||
|
url = strdup(queue_item->artwork_url);
|
||||||
|
free_queue_item(queue_item, 0);
|
||||||
|
|
||||||
len = strlen(url);
|
len = strlen(url);
|
||||||
if ((len < 14) || (len > PATH_MAX)) // Can't be shorter than http://a/1.jpg
|
if ((len < 14) || (len > PATH_MAX)) // Can't be shorter than http://a/1.jpg
|
||||||
|
Loading…
Reference in New Issue
Block a user