mirror of
https://github.com/Goldenkrew3000/OSSP_OpenSource.git
synced 2026-02-16 04:05:18 +10:00
Fixed GStreamer error printing and added option to disable sending cover
art to Discord RPC (Security issue) GStreamer's GError is a struct, not a char*, with GError->message being the actual char* message. Since Subsonic/OpenSubsonic servers don't have a way of sending cover art unauthenticated, sending cover art to Discord using Discord RPC exposes an authenticated URL to Discord servers (But only Discord since it is then proxy'd). Added a config option to disable this behavior and only use the app icon if the user doesn't feel comfortable enough to trust Discord (understandable tbh)
This commit is contained in:
@@ -47,6 +47,7 @@ int configHandler_Read(configHandler_config_t** configObj) {
|
||||
(*configObj)->discordrpc_enable = false;
|
||||
(*configObj)->discordrpc_method = 0;
|
||||
(*configObj)->discordrpc_showSysDetails = false;
|
||||
(*configObj)->discordrpc_showCoverArt = false;
|
||||
(*configObj)->audio_equalizer_enable = false;
|
||||
(*configObj)->audio_equalizer_followPitch = false;
|
||||
(*configObj)->audio_equalizer_graphCount = 0;
|
||||
@@ -251,6 +252,13 @@ int configHandler_Read(configHandler_config_t** configObj) {
|
||||
}
|
||||
}
|
||||
|
||||
cJSON* discordrpc_showCoverArt = cJSON_GetObjectItemCaseSensitive(discordrpc_root, "showCoverArt");
|
||||
if (cJSON_IsBool(discordrpc_showCoverArt)) {
|
||||
if (cJSON_IsTrue(discordrpc_showCoverArt)) {
|
||||
(*configObj)->discordrpc_showCoverArt = true;
|
||||
}
|
||||
}
|
||||
|
||||
// Make an object from audio
|
||||
cJSON* audio_root = cJSON_GetObjectItemCaseSensitive(root, "audio");
|
||||
if (audio_root == NULL) {
|
||||
|
||||
@@ -40,6 +40,7 @@ typedef struct {
|
||||
bool discordrpc_enable; // Enable Discord RPC
|
||||
int discordrpc_method; // Discord RPC Method (0 = Regular, 1 = DscrdRPC)
|
||||
bool discordrpc_showSysDetails; // Show 'on OS ARCH VERSION' in RPC
|
||||
bool discordrpc_showCoverArt; // Show cover art instead of app icon (Leaks credentials to Discord)
|
||||
|
||||
// Audio Settings
|
||||
bool audio_equalizer_enable;
|
||||
@@ -62,7 +63,7 @@ typedef struct {
|
||||
char* lv2_parax32_quality_right;
|
||||
char* lv2_parax32_frequency_left;
|
||||
char* lv2_parax32_frequency_right;
|
||||
char* lv2_reverb_filter_name; // LV2 Calf Reeverb LV2 Name
|
||||
char* lv2_reverb_filter_name; // LV2 Calf Reverb LV2 Name
|
||||
} configHandler_config_t;
|
||||
|
||||
int configHandler_Read(configHandler_config_t** config);
|
||||
|
||||
@@ -51,7 +51,7 @@ static gboolean gst_bus_call(GstBus* bus, GstMessage* message, gpointer data) {
|
||||
gchar* debug;
|
||||
GError* error;
|
||||
gst_message_parse_error(message, &error, &debug);
|
||||
printf("Gstreamer Error: %s\n", error);
|
||||
printf("Gstreamer Error: %s\n", error->message);
|
||||
g_error_free(error);
|
||||
g_free(debug);
|
||||
break;
|
||||
@@ -150,7 +150,9 @@ void* OSSPlayer_ThrdInit(void*) {
|
||||
discordrpc->songLength = songStruct->duration;
|
||||
discordrpc->songTitle = strdup(songStruct->title);
|
||||
discordrpc->songArtist = strdup(songStruct->artist);
|
||||
//discordrpc->coverArtUrl = strdup(coverart_url->formedUrl);
|
||||
if (configObj->discordrpc_showCoverArt) {
|
||||
discordrpc->coverArtUrl = strdup(coverart_url->formedUrl);
|
||||
}
|
||||
discordrpc_update(&discordrpc);
|
||||
discordrpc_struct_deinit(&discordrpc);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user