Skip to content

Commit

Permalink
Upd: migrate webradio favorites to new webradio interface
Browse files Browse the repository at this point in the history
  • Loading branch information
jcorporation committed Jun 27, 2024
1 parent 9a5bbc8 commit 8b11a19
Show file tree
Hide file tree
Showing 34 changed files with 510 additions and 746 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,12 @@ This release improves the WebradioDB integration and removes the radiobrowser.in
### API changes

- MYMPD_API_WEBRADIODB_UPDATE: new
- MYMPD_API_WEBRADIODB_SEARCH: new
- MYMPD_API_WEBRADIODB_LIST renamed to MYMPD_API_WEBRADIODB_SEARCH
- MYMPD_API_WEBRADIO_FAVORITE_GET_BY_NAME: new
- MYMPD_API_WEBRADIO_FAVORITE_GET_BY_URI: new
- MYMPD_API_WEBRADIODB_RADIO_GET_BY_NAME: new
- MYMPD_API_WEBRADIODB_RADIO_GET_BY_URI: new
- MYMPD_API_CLOUD_WEBRADIODB_COMBINED_GET: removed
- MYMPD_API_CLOUD_RADIOBROWSER_NEWEST: removed
- MYMPD_API_CLOUD_RADIOBROWSER_SEARCH: removed
Expand Down
26 changes: 13 additions & 13 deletions docs/references/translating_status.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
- bg-BG: 1049 missing phrases
- es-AR: 3 missing phrases
- bg-BG: 1050 missing phrases
- es-AR: 5 missing phrases
- es-ES: 915 missing phrases
- es-VE: 905 missing phrases
- fi-FI: 902 missing phrases
- fr-FR: 3 missing phrases
- it-IT: 33 missing phrases
- ja-JP: 3 missing phrases
- ko-KR: 3 missing phrases
- nl-NL: 3 missing phrases
- pl-PL: 78 missing phrases
- ru-RU: 149 missing phrases
- zh-Hans: 31 missing phrases
- zh-Hant: 78 missing phrases
- es-VE: 904 missing phrases
- fi-FI: 901 missing phrases
- fr-FR: 5 missing phrases
- it-IT: 35 missing phrases
- ja-JP: 5 missing phrases
- ko-KR: 5 missing phrases
- nl-NL: 5 missing phrases
- pl-PL: 80 missing phrases
- ru-RU: 151 missing phrases
- zh-Hans: 33 missing phrases
- zh-Hant: 80 missing phrases
1 change: 1 addition & 0 deletions docs/references/webserver-uris.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,6 @@ Reference of all webserver uris.
| `/serverinfo` | Returns the ip address of myMPD |
| `/stream/<partition>` | Reverse proxy for mpd http stream |
| `/tagart?tag=<tagname>&value=<tagvalue>` | Returns the tagart thumbnail. |
| `/webradio?uri=<webradio uri>` | Webradio endpoint |
| `/ws/<partition>` | Websocket endpoint |
{: .table .table-sm }
1 change: 1 addition & 0 deletions htdocs/sw.js.in
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ const ignoreRequests = new RegExp(subdir + '/(' + [
'tagart.*',
'folderart.*',
'playlistart.*',
'webradio.*',
'proxy.*',
'browse/.*'].join('|') + ')$');

Expand Down
5 changes: 3 additions & 2 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@ target_sources(mympd
lib/last_played.c
lib/list.c
lib/log.c
lib/m3u.c
lib/mg_str_utils.c
lib/mimetype.c
lib/mpack.c
Expand Down Expand Up @@ -138,7 +137,9 @@ target_sources(mympd
mympd_api/timer_handlers.c
mympd_api/trigger.c
mympd_api/volume.c
mympd_api/webradios.c
mympd_api/webradio.c
mympd_api/webradiodb.c
mympd_api/webradio_favorites.c
web_server/web_server.c
web_server/albumart.c
web_server/folderart.c
Expand Down
2 changes: 1 addition & 1 deletion src/compile_time.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ extern struct t_mympd_queue *mympd_api_queue;
#define FILENAME_TIMER "timer_list"
#define FILENAME_TRIGGER "trigger_list"
#define FILENAME_WEBRADIODB "webradiodb.mpack"
#define FILENAME_WEBRADIO_FAVORITES "webradio_favorites.mpack"
#define FILENAME_SCRIPTVARS "scriptvars_list"

#define DIR_CACHE_COVER "cover"
Expand All @@ -109,7 +110,6 @@ extern struct t_mympd_queue *mympd_api_queue;
#define DIR_WORK_STATE "state"
#define DIR_WORK_STATE_DEFAULT DIR_WORK_STATE"/default"
#define DIR_WORK_TAGS "tags"
#define DIR_WORK_WEBRADIOS "webradios"

//mpd partitions
#define MPD_PARTITION_DEFAULT "default"
Expand Down
20 changes: 10 additions & 10 deletions src/i18n/json/i18n.json
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": 3},
"de-DE": {"desc":"Deutsch (de-DE)", "missingPhrases": 5},
"en-US": {"desc":"English (en-US)", "missingPhrases": 0},
"es-AR": {"desc":"Español (es-AR)", "missingPhrases": 3},
"fr-FR": {"desc":"Français (fr-FR)", "missingPhrases": 3},
"it-IT": {"desc":"Italiano (it-IT)", "missingPhrases": 33},
"ja-JP": {"desc":"日本語 (ja-JP)", "missingPhrases": 3},
"ko-KR": {"desc":"한국어 (ko-KR)", "missingPhrases": 3},
"nl-NL": {"desc":"Nederlands (nl-NL)", "missingPhrases": 3},
"pl-PL": {"desc":"Polish (pl-PL)", "missingPhrases": 78},
"zh-Hans": {"desc":"简体中文 (zh-Hans)", "missingPhrases": 31},
"zh-Hant": {"desc":"简体中文 (zh-Hant)", "missingPhrases": 78}
"es-AR": {"desc":"Español (es-AR)", "missingPhrases": 5},
"fr-FR": {"desc":"Français (fr-FR)", "missingPhrases": 5},
"it-IT": {"desc":"Italiano (it-IT)", "missingPhrases": 35},
"ja-JP": {"desc":"日本語 (ja-JP)", "missingPhrases": 5},
"ko-KR": {"desc":"한국어 (ko-KR)", "missingPhrases": 5},
"nl-NL": {"desc":"Nederlands (nl-NL)", "missingPhrases": 5},
"pl-PL": {"desc":"Polish (pl-PL)", "missingPhrases": 80},
"zh-Hans": {"desc":"简体中文 (zh-Hans)", "missingPhrases": 33},
"zh-Hant": {"desc":"简体中文 (zh-Hant)", "missingPhrases": 80}
}
5 changes: 2 additions & 3 deletions src/i18n/json/phrases.json
Original file line number Diff line number Diff line change
Expand Up @@ -108,13 +108,11 @@
{"term":"Can not move home icon"},
{"term":"Can not open directory pics"},
{"term":"Can not open script"},
{"term":"Can not open webradios directory"},
{"term":"Can not parse response from %{uri}"},
{"term":"Can not parse script arguments"},
{"term":"Can not parse script metadata."},
{"term":"Can not parse settings"},
{"term":"Can not parse smart playlist file"},
{"term":"Can not parse webradio favorite file"},
{"term":"Can not read smart playlist file"},
{"term":"Can not save home icon"},
{"term":"Can't delete script variable"},
Expand Down Expand Up @@ -583,7 +581,7 @@
{"term":"No song positions provided"},
{"term":"No tagart found."},
{"term":"No uris provided"},
{"term":"No webradios provided"},
{"term":"No webradio favorites provided"},
{"term":"None"},
{"term":"Not playing"},
{"term":"Notification icon"},
Expand Down Expand Up @@ -976,6 +974,7 @@
{"term":"Web notifications are blocked by the browser"},
{"term":"Webradio"},
{"term":"Webradio details"},
{"term":"Webradio favorite not found"},
{"term":"Webradio favorite successfully saved"},
{"term":"Webradio favorites"},
{"term":"WebradioDB"},
Expand Down
8 changes: 6 additions & 2 deletions src/lib/api.h
Original file line number Diff line number Diff line change
Expand Up @@ -205,10 +205,14 @@
X(MYMPD_API_TRIGGER_RM) \
X(MYMPD_API_TRIGGER_SAVE) \
X(MYMPD_API_VIEW_SAVE) \
X(MYMPD_API_WEBRADIO_FAVORITE_GET) \
X(MYMPD_API_WEBRADIO_FAVORITE_LIST) \
X(MYMPD_API_WEBRADIO_FAVORITE_GET_BY_NAME) \
X(MYMPD_API_WEBRADIO_FAVORITE_GET_BY_URI) \
X(MYMPD_API_WEBRADIO_FAVORITE_RM) \
X(MYMPD_API_WEBRADIO_FAVORITE_SAVE) \
X(MYMPD_API_WEBRADIO_FAVORITE_SEARCH) \
X(MYMPD_API_WEBRADIODB_RADIO_GET_BY_NAME) \
X(MYMPD_API_WEBRADIODB_RADIO_GET_BY_URI) \
X(MYMPD_API_WEBRADIODB_SEARCH) \
X(MYMPD_API_WEBRADIODB_UPDATE) \
X(TOTAL_API_COUNT)

Expand Down
156 changes: 0 additions & 156 deletions src/lib/m3u.c

This file was deleted.

15 changes: 0 additions & 15 deletions src/lib/m3u.h

This file was deleted.

5 changes: 4 additions & 1 deletion src/lib/mympd_state.c
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ void mympd_state_save(struct t_mympd_state *mympd_state, bool free_data) {
mympd_api_home_file_save(&mympd_state->home_list, mympd_state->config->workdir);
mympd_api_timer_file_save(&mympd_state->timer_list, mympd_state->config->workdir);
mympd_api_trigger_file_save(&mympd_state->trigger_list, mympd_state->config->workdir);
webradios_save_to_disk(mympd_state->config, mympd_state->webradio_favorites, FILENAME_WEBRADIO_FAVORITES);
if (free_data == true) {
mympd_state_free(mympd_state);
}
Expand Down Expand Up @@ -126,8 +127,9 @@ void mympd_state_default(struct t_mympd_state *mympd_state, struct t_config *con
mympd_state->last_played_count = MYMPD_LAST_PLAYED_COUNT;
//poll fds
event_pfd_init(&mympd_state->pfds);
//webradioDB
//webradios
mympd_state->webradiodb = webradios_new();
mympd_state->webradio_favorites = webradios_new();
}

/**
Expand Down Expand Up @@ -158,6 +160,7 @@ void mympd_state_free(struct t_mympd_state *mympd_state) {
cache_free(&mympd_state->album_cache);
//webradioDB
webradios_free(mympd_state->webradiodb);
webradios_free(mympd_state->webradio_favorites);
//sds
FREE_SDS(mympd_state->tag_list_search);
FREE_SDS(mympd_state->tag_list_browse);
Expand Down
3 changes: 2 additions & 1 deletion src/lib/mympd_state.h
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,8 @@ struct t_mympd_state {
sds info_txt_name; //!< name of album info files
struct t_cache album_cache; //!< the album cache created by the mpd_worker thread
unsigned last_played_count; //!< number of songs to keep in the last played list (disk + memory)
struct t_webradios *webradiodb; //!< webradioDB
struct t_webradios *webradiodb; //!< WebradioDB
struct t_webradios *webradio_favorites; //!< webradio favorites
};

/**
Expand Down
4 changes: 2 additions & 2 deletions src/lib/utility.c
Original file line number Diff line number Diff line change
Expand Up @@ -229,8 +229,8 @@ struct t_mympd_uris {
};

const struct t_mympd_uris mympd_uris[] = {
{"mympd://webradio/", "/browse/"DIR_WORK_WEBRADIOS"/"},
{"mympd://", "/"},
{"mympd://webradio/", "/webradio?uri=" },
{"mympd://", "/"},
{NULL, NULL}
};

Expand Down
Loading

0 comments on commit 8b11a19

Please sign in to comment.