mirror of
https://github.com/owntone/owntone-server.git
synced 2025-11-09 05:34:58 -05:00
[spotify] Move "has_podcast_support" to spotify_status and expose this
flag in the web API
This commit is contained in:
@@ -144,14 +144,3 @@ spotify_status_get(struct spotify_status *status)
|
||||
|
||||
backend->status_get(status);
|
||||
}
|
||||
|
||||
bool
|
||||
spotify_podcast_support()
|
||||
{
|
||||
struct spotify_backend *backend = backend_set();
|
||||
|
||||
if (!backend)
|
||||
return false;
|
||||
|
||||
return backend->has_podcast_support;
|
||||
}
|
||||
|
||||
@@ -9,6 +9,7 @@ struct spotify_status
|
||||
bool installed;
|
||||
bool logged_in;
|
||||
char username[128];
|
||||
bool has_podcast_support;
|
||||
};
|
||||
|
||||
struct spotify_backend
|
||||
@@ -21,8 +22,6 @@ struct spotify_backend
|
||||
int (*relogin)(void);
|
||||
void (*uri_register)(const char *uri);
|
||||
void (*status_get)(struct spotify_status *status);
|
||||
|
||||
bool has_podcast_support;
|
||||
};
|
||||
|
||||
int
|
||||
@@ -49,7 +48,4 @@ spotify_uri_register(const char *uri);
|
||||
void
|
||||
spotify_status_get(struct spotify_status *status);
|
||||
|
||||
bool
|
||||
spotify_podcast_support();
|
||||
|
||||
#endif /* !__SPOTIFY_H__ */
|
||||
|
||||
@@ -738,6 +738,7 @@ status_get(struct spotify_status *status)
|
||||
memcpy(status->username, ctx->status.username, sizeof(status->username));
|
||||
status->logged_in = ctx->status.logged_in;
|
||||
status->installed = true;
|
||||
status->has_podcast_support = true;
|
||||
|
||||
pthread_mutex_unlock(&ctx->lock);
|
||||
}
|
||||
@@ -749,7 +750,5 @@ struct spotify_backend spotify_librespotc =
|
||||
.logout = logout,
|
||||
.relogin = relogin,
|
||||
.status_get = status_get,
|
||||
|
||||
.has_podcast_support = true,
|
||||
};
|
||||
|
||||
|
||||
@@ -116,6 +116,7 @@ status_get(struct spotify_status *status)
|
||||
|
||||
status->installed = info.libspotify_installed;
|
||||
status->logged_in = info.libspotify_logged_in;
|
||||
status->has_podcast_support = false;
|
||||
snprintf(status->username, sizeof(status->username), "%s", info.libspotify_user);
|
||||
}
|
||||
|
||||
@@ -129,7 +130,5 @@ struct spotify_backend spotify_libspotify =
|
||||
.relogin = libspotify_relogin,
|
||||
.uri_register = libspotify_uri_register,
|
||||
.status_get = status_get,
|
||||
|
||||
.has_podcast_support = false,
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user