-
-
Notifications
You must be signed in to change notification settings - Fork 63
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Feat: Implement update of webradioDB and population of internal strcut …
- Loading branch information
1 parent
41504fb
commit f7b0fea
Showing
26 changed files
with
416 additions
and
293 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,14 @@ | ||
- bg-BG: 1049 missing phrases | ||
- es-AR: fully translated | ||
- bg-BG: 1048 missing phrases | ||
- es-AR: 2 missing phrases | ||
- es-ES: 914 missing phrases | ||
- es-VE: 905 missing phrases | ||
- fi-FI: 902 missing phrases | ||
- fr-FR: fully translated | ||
- it-IT: 30 missing phrases | ||
- ja-JP: fully translated | ||
- ko-KR: fully translated | ||
- nl-NL: fully translated | ||
- pl-PL: 75 missing phrases | ||
- ru-RU: 146 missing phrases | ||
- zh-Hans: 28 missing phrases | ||
- zh-Hant: 75 missing phrases | ||
- es-VE: 904 missing phrases | ||
- fi-FI: 901 missing phrases | ||
- fr-FR: 2 missing phrases | ||
- it-IT: 32 missing phrases | ||
- ja-JP: 2 missing phrases | ||
- ko-KR: 2 missing phrases | ||
- nl-NL: 2 missing phrases | ||
- pl-PL: 77 missing phrases | ||
- ru-RU: 148 missing phrases | ||
- zh-Hans: 30 missing phrases | ||
- zh-Hant: 77 missing phrases |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,14 @@ | ||
{ | ||
"default": {"desc":"Browser default", "missingPhrases": 0}, | ||
"de-DE": {"desc":"Deutsch (de-DE)", "missingPhrases": 0}, | ||
"de-DE": {"desc":"Deutsch (de-DE)", "missingPhrases": 2}, | ||
"en-US": {"desc":"English (en-US)", "missingPhrases": 0}, | ||
"es-AR": {"desc":"Español (es-AR)", "missingPhrases": 0}, | ||
"fr-FR": {"desc":"Français (fr-FR)", "missingPhrases": 0}, | ||
"it-IT": {"desc":"Italiano (it-IT)", "missingPhrases": 30}, | ||
"ja-JP": {"desc":"日本語 (ja-JP)", "missingPhrases": 0}, | ||
"ko-KR": {"desc":"한국어 (ko-KR)", "missingPhrases": 0}, | ||
"nl-NL": {"desc":"Nederlands (nl-NL)", "missingPhrases": 0}, | ||
"pl-PL": {"desc":"Polish (pl-PL)", "missingPhrases": 75}, | ||
"zh-Hans": {"desc":"简体中文 (zh-Hans)", "missingPhrases": 28}, | ||
"zh-Hant": {"desc":"简体中文 (zh-Hant)", "missingPhrases": 75} | ||
"es-AR": {"desc":"Español (es-AR)", "missingPhrases": 2}, | ||
"fr-FR": {"desc":"Français (fr-FR)", "missingPhrases": 2}, | ||
"it-IT": {"desc":"Italiano (it-IT)", "missingPhrases": 32}, | ||
"ja-JP": {"desc":"日本語 (ja-JP)", "missingPhrases": 2}, | ||
"ko-KR": {"desc":"한국어 (ko-KR)", "missingPhrases": 2}, | ||
"nl-NL": {"desc":"Nederlands (nl-NL)", "missingPhrases": 2}, | ||
"pl-PL": {"desc":"Polish (pl-PL)", "missingPhrases": 77}, | ||
"zh-Hans": {"desc":"简体中文 (zh-Hans)", "missingPhrases": 30}, | ||
"zh-Hant": {"desc":"简体中文 (zh-Hant)", "missingPhrases": 77} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,94 @@ | ||
/* | ||
SPDX-License-Identifier: GPL-3.0-or-later | ||
myMPD (c) 2018-2024 Juergen Mang <mail@jcgames.de> | ||
https://github.com/jcorporation/mympd | ||
*/ | ||
|
||
#include "compile_time.h" | ||
#include "src/lib/webradio.h" | ||
|
||
#include "src/lib/mem.h" | ||
#include "src/lib/sds_extras.h" | ||
|
||
/** | ||
* Creates a new webradio data struct | ||
* @return struct t_webradio_data* | ||
*/ | ||
struct t_webradio_data *webradio_data_new(void) { | ||
struct t_webradio_data *data = malloc_assert(sizeof(struct t_webradio_data)); | ||
list_init(&data->uris); | ||
list_init(&data->genres); | ||
list_init(&data->languages); | ||
data->name = NULL; | ||
data->image = NULL; | ||
data->homepage = NULL; | ||
data->country = NULL; | ||
data->state = NULL; | ||
data->description = NULL; | ||
return data; | ||
} | ||
|
||
/** | ||
* Frees a webradios data struct | ||
* @param data struct to free | ||
*/ | ||
void webradio_data_free(struct t_webradio_data *data) { | ||
if (data == NULL) { | ||
return; | ||
} | ||
list_clear(&data->uris); | ||
list_clear(&data->genres); | ||
list_clear(&data->languages); | ||
FREE_SDS(data->name); | ||
FREE_SDS(data->image); | ||
FREE_SDS(data->homepage); | ||
FREE_SDS(data->country); | ||
FREE_SDS(data->state); | ||
FREE_SDS(data->description); | ||
// pointer data itself | ||
FREE_PTR(data); | ||
} | ||
|
||
/** | ||
* Frees the webradios rax | ||
* @param webradios rax tree to free | ||
*/ | ||
void webradio_free(rax *webradios) { | ||
raxIterator iter; | ||
raxStart(&iter, webradios); | ||
raxSeek(&iter, "^", NULL, 0); | ||
while (raxNext(&iter)) { | ||
webradio_data_free((struct t_webradio_data *)iter.data); | ||
iter.data = NULL; | ||
} | ||
raxStop(&iter); | ||
raxFree(webradios); | ||
} | ||
|
||
/** | ||
* Saves the webradios to disk | ||
* @param config pointer to config | ||
* @param webradios webradios rax to write | ||
* @param filename file to write | ||
* @return true on success, else false | ||
*/ | ||
bool webradio_save_to_disk(struct t_config *config, rax *webradios, const char *filename) { | ||
(void)config; | ||
(void)webradios; | ||
(void)filename; | ||
//TODO: implement | ||
return true; | ||
} | ||
|
||
/** | ||
* Reads the webradios file from disk | ||
* @param config pointer to config | ||
* @param filename file to read | ||
* @return newly allocated rax with webradios | ||
*/ | ||
rax *webradio_read_from_disk(struct t_config *config, const char *filename) { | ||
(void)config; | ||
(void)filename; | ||
//TODO: implement | ||
return NULL; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
/* | ||
SPDX-License-Identifier: GPL-3.0-or-later | ||
myMPD (c) 2018-2024 Juergen Mang <mail@jcgames.de> | ||
https://github.com/jcorporation/mympd | ||
*/ | ||
|
||
#ifndef MYMPD_LIB_WEBRADIO_H | ||
#define MYMPD_LIB_WEBRADIO_H | ||
|
||
#include "dist/rax/rax.h" | ||
#include "dist/sds/sds.h" | ||
#include "src/lib/config_def.h" | ||
#include "src/lib/list.h" | ||
|
||
struct t_webradio_data { | ||
sds name; | ||
sds image; | ||
sds homepage; | ||
sds country; | ||
sds state; | ||
sds description; | ||
struct t_list uris; | ||
struct t_list genres; | ||
struct t_list languages; | ||
}; | ||
|
||
struct t_webradio_data *webradio_data_new(void); | ||
void webradio_data_free(struct t_webradio_data *data); | ||
|
||
void webradio_free(rax *webradios); | ||
bool webradio_save_to_disk(struct t_config *config, rax *webradios, const char *filename); | ||
rax *webradio_read_from_disk(struct t_config *config, const char *filename); | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.