Skip to content

Support for clients to write to the medialib

Erik Massop edited this page Nov 4, 2017 · 1 revision

This idea has been implemented

Alright I have started to work on this but I need some feedback on the functionality. I have three ideas that I am following right now basic in all of them are that there is going to be two new calls in the clientlib:

xmmsc_medialib_property_set_str(c, id, property, value); xmmsc_medialib_property_set_int(c, id, property, value);

The problem is the extraction here we some choises:

  1. the original idea was to expand the Media table in the medialib with a new column called source, this would indicate if a value came from the server (plugins etc) or the client. The advantage of this was that you where able to override a server set property without removing the orginal value. Then the client could:

    1. set a config value and tell you if you wanted data from the server or from the client or
    2. have a flag to the medialib_get_info() call that would tell you what kind of data you had.
  2. The second approach is to just have a policy which is forced upon entering data and optional when recieving. Like all properties from the client is named with a dash first (i.e: "_title") and then when the client retrieved all entries it could choose which to use.

I think I like 2 most. the problem with it is that you are locked to just two origins. 1 could be expanded to support an infinite number of origins, but the problem is that you have to change the API or have a global configuration variable for what data you want.

What do you guys think?

I think that 2 is just an ugly hackish shortsigthed crappy way to implement 1. -- anders

1.3: give the client all data, from all sources. Then it is up to the client to decide which to use..

The api could have this function (but has sane defaults)

xmmsc_set_source_preference({"core/*", "plugin/*", "client/myclient", "client/*", "*/*", NULL});

would make xmmsc_result_get_dict_entry_int32 behave like today, but using the specified preference. xmmsc_result_get_dict_entry_XXX_src could be used to get a specific source.

The foreach-func should be extended to include the source.

Btw, there are not many nodes, so we could proabaly just ditch the hashtable internally, and store them in a list of (key, source, property) instead.

See Also

Clone this wiki locally