Implement Album and Track metadata for duration and genres.

For tracks, we will fetch the duration from the ID3 tag information, alongside genres. These genres will be used for multiple purposes, e.g. search. At the moment however, it is used in koto_album_add_track to collate a list of genres that apply to the album based on the contents of it.

We can have multiple genres, we separate them by semi-column as is the case for TagLib. We will attempt to filter and rename some select genres to enforce consistency.

Changed position and playback position from guint to guint64.

Implemented multiple koto utility functions:

- koto_utils_join_string_list
- koto_utils_string_contains_substring
- koto_utils_string_to_string_list

Drastically simplified koto_utils_replace_string_all.

Implement koto_track_helpers_init to initialize our hashtable.

Fixed a segfault during first load of Koto where we were attempting to get the playback engine last used volume in koto_config_save, when the KotoPlaybackEngine was not yet initialized. Default it to 1.0.
This commit is contained in:
Joshua Strobl 2021-07-08 18:37:52 +03:00
parent 812cdc6677
commit 381cc9ce4c
15 changed files with 387 additions and 44 deletions

View file

@ -506,7 +506,12 @@ void koto_config_save(KotoConfig * self) {
gchar * playback_hash = g_strdup("playback");
gchar * ui_hash = g_strdup("ui");
gdouble current_playback_volume = koto_playback_engine_get_volume(playback_engine); // Get the last used volume in the playback engine
gdouble current_playback_volume = 1.0;
if (KOTO_IS_PLAYBACK_ENGINE(playback_engine)) { // Have a playback engine (useful since it may not be initialized before the config performs saving on first application load)
current_playback_volume = koto_playback_engine_get_volume(playback_engine); // Get the last used volume in the playback engine
}
self->playback_last_used_volume = current_playback_volume; // Update our value so we have it during save
int i;