Implemented library hashtable, added / removed signals into Cartographer, add / remove / getters (ish).

Added KOTO_IS_CARTOGRAPHER macro and added that type check across all cartographer functions. Added more type checks and dropped use of g_object_get for UUIDs where possible.

Implemented koto_album_get_uuid function to be on parity with other structs like Artist, Playlist, Track.
This commit is contained in:
Joshua Strobl 2021-06-01 12:58:23 +03:00
parent fc670e266f
commit 7c7fe35b49
4 changed files with 360 additions and 56 deletions

View file

@ -34,6 +34,8 @@ typedef struct _KotoCartographerClass KotoCartographerClass;
GLIB_AVAILABLE_IN_ALL
GType koto_cartographer_get_type(void) G_GNUC_CONST;
#define KOTO_IS_CARTOGRAPHER(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), KOTO_TYPE_CARTOGRAPHER))
/**
* Cartographer Functions
**/
@ -50,6 +52,11 @@ void koto_cartographer_add_artist(
KotoArtist * artist
);
void koto_cartographer_add_library(
KotoCartographer * self,
KotoLibrary * library
);
void koto_cartographer_add_playlist(
KotoCartographer * self,
KotoPlaylist * playlist
@ -82,6 +89,16 @@ KotoArtist * koto_cartographer_get_artist_by_uuid(
gchar * artist_uuid
);
KotoLibrary * koto_cartographer_get_library_by_uuid(
KotoCartographer *self,
gchar * library_uuid
);
GList * koto_cartographer_get_libraries_for_storage_uuid(
KotoCartographer *self,
gchar * storage_uuid
);
KotoPlaylist * koto_cartographer_get_playlist_by_uuid(
KotoCartographer * self,
gchar * playlist_uuid
@ -114,6 +131,16 @@ gboolean koto_cartographer_has_artist_by_uuid(
gchar * artist_uuid
);
gboolean koto_cartographer_has_library(
KotoCartographer * self,
KotoLibrary *library
);
gboolean koto_cartographer_has_library_by_uuid(
KotoCartographer * self,
gchar * library_uuid
);
gboolean koto_cartographer_has_playlist(
KotoCartographer * self,
KotoPlaylist * playlist
@ -154,6 +181,11 @@ void koto_cartographer_remove_artist_by_uuid(
gchar * artist_uuid
);
void koto_cartographer_remove_library(
KotoCartographer * self,
KotoLibrary * library
);
void koto_cartographer_remove_playlist(
KotoCartographer * self,
KotoPlaylist * playlist