mirror of
https://github.com/owntone/owntone-server.git
synced 2025-11-10 22:10:15 -05:00
[http] Also allow remote playlists to have https streams (fixes #1251)
Fix it by adding net_is_http_or_https() utility function in misc.h and make sure it used whenever a http protocol check is made.
This commit is contained in:
@@ -1775,7 +1775,7 @@ queue_item_stream_add(const char *path, int position, char reshuffle, uint32_t i
|
||||
static int
|
||||
queue_item_add(const char *uri, int position, char reshuffle, uint32_t item_id, int *count, int *new_item_id)
|
||||
{
|
||||
if (strncasecmp(uri, "http://", strlen("http://")) == 0 || strncasecmp(uri, "https://", strlen("https://")) == 0)
|
||||
if (net_is_http_or_https(uri))
|
||||
{
|
||||
queue_item_stream_add(uri, position, reshuffle, item_id, count, new_item_id);
|
||||
return LIBRARY_OK;
|
||||
@@ -1941,7 +1941,7 @@ playlist_add_files(FILE *fp, int pl_id, const char *virtual_path)
|
||||
DPRINTF(E_DBG, L_SCAN, "Item '%s' added to playlist (id = %d)\n", dbmfi.path, pl_id);
|
||||
}
|
||||
}
|
||||
else if (strncasecmp(virtual_path, "/http://", strlen("/http://")) == 0 || strncasecmp(virtual_path, "/https://", strlen("/https://")) == 0)
|
||||
else if (virtual_path[0] != '\0' && net_is_http_or_https(virtual_path + 1))
|
||||
{
|
||||
path = (virtual_path + 1);
|
||||
|
||||
|
||||
@@ -485,7 +485,7 @@ scan_playlist(const char *file, time_t mtime, int dir_id)
|
||||
continue;
|
||||
|
||||
// URLs and playlists will be added to library, tracks should already be there
|
||||
if (strncasecmp(path, "http://", 7) == 0 || strncasecmp(path, "https://", 8) == 0)
|
||||
if (net_is_http_or_https(path))
|
||||
ret = process_url(pl_id, path, &mfi);
|
||||
else if (playlist_type(path) != PLAYLIST_UNKNOWN)
|
||||
ret = process_nested_playlist(pl_id, path);
|
||||
|
||||
@@ -622,7 +622,7 @@ rss_add(const char *path)
|
||||
{
|
||||
int ret;
|
||||
|
||||
if (strncmp(path, "http://", 7) != 0 && strncmp(path, "https://", 8) != 0)
|
||||
if (!net_is_http_or_https(path))
|
||||
{
|
||||
DPRINTF(E_SPAM, L_LIB, "Invalid RSS path '%s'\n", path);
|
||||
return LIBRARY_PATH_INVALID;
|
||||
|
||||
Reference in New Issue
Block a user