Implemented clearer database functions and response codes so we know when to do library indexing.
Implement reading of artists, albums, and tracks. Fixed a bug related to unnecessary file name parsing. Fix SIGSEGV related to file name parsing and koto_utils_get_filename_without_extension. Implemented an unquote string function for use when reading database entries. Try to fix some weird random rendering issues. Changed where we are doing some KotoPageMusicLocal widget construction.
This commit is contained in:
parent
7566fb39f9
commit
35762ca233
12 changed files with 346 additions and 167 deletions
|
@ -54,7 +54,7 @@ gchar* koto_utils_get_filename_without_extension(gchar *filename) {
|
|||
} else {
|
||||
gchar *tmp_copy = g_strdup(new_parsed_name);
|
||||
g_free(new_parsed_name); // Free the old
|
||||
new_parsed_name = g_strdup(g_strjoin(".", tmp_copy, split[i], NULL)); // Join the two strings with a . again and duplicate it, setting it to our new_parsed_name
|
||||
new_parsed_name = g_strjoin(".", tmp_copy, split[i], NULL); // Join the two strings with a . again and duplicate it, setting it to our new_parsed_name
|
||||
g_free(tmp_copy); // Free our temporary copy
|
||||
}
|
||||
}
|
||||
|
@ -67,3 +67,19 @@ gchar* koto_utils_get_filename_without_extension(gchar *filename) {
|
|||
g_free(trimmed_file_name);
|
||||
return stripped_file_name;
|
||||
}
|
||||
|
||||
gchar* koto_utils_unquote_string(gchar *s) {
|
||||
gchar *new_s = NULL;
|
||||
|
||||
if (g_str_has_prefix(s, "'") && g_str_has_suffix(s, "'")) { // Begins and ends with '
|
||||
new_s = g_utf8_substring(s, 1, g_utf8_strlen(s, -1)-1); // Start at 1 and end at n-1
|
||||
} else {
|
||||
new_s = g_strdup(s);
|
||||
}
|
||||
|
||||
gchar **split_on_double_single = g_strsplit(new_s, "''", -1); // Split on instances of ''
|
||||
new_s = g_strjoinv("'", split_on_double_single); // Rejoin as '
|
||||
g_strfreev(split_on_double_single); // Free our array
|
||||
|
||||
return new_s;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue