if (item != NULL) {
RygelMediaObject *object;
+ GeeArrayList* uris;
- RYGEL_MEDIA_ITEM (item)->mime_type = g_strdup (content_type);
+ rygel_media_item_set_mime_type (RYGEL_MEDIA_ITEM (item), content_type);
object = RYGEL_MEDIA_OBJECT (item);
gee_collection_add (GEE_COLLECTION (object->uris), uri);
+
rygel_simple_container_add_child_item (root_container, item);
}
using Gee;
internal class Rygel.HTTPItemURI : Object {
- public string item_id;
- public int thumbnail_index;
- public int subtitle_index;
- public string? transcode_target;
- public unowned HTTPServer http_server;
- private string real_extension;
+ public string item_id { get; set; }
+ public int thumbnail_index { get; set; default = -1; }
+ public int subtitle_index { get; set; default = -1; }
+ public string? transcode_target { get; set; default = null; }
+ public unowned HTTPServer http_server { get; set; }
+ private string real_extension { get; set; }
public string extension {
owned get {
if (this.real_extension != "") {
* These objects correspond to items in the UPnP ContentDirectory's DIDL-Lite XML.
*/
public abstract class Rygel.MediaItem : MediaObject {
- public string date;
+ public string date { get; set; }
// Resource info
- public string mime_type;
- public string dlna_profile;
+ public string mime_type { get; set; }
+ public string dlna_profile { get; set; }
// Size in bytes
private int64 _size = -1;
private static Regex user_name_regex;
private static Regex host_name_regex;
- public string id;
- public string ref_id;
- public string upnp_class;
- public uint64 modified;
- public uint object_update_id;
+ public string id { get; set; }
+ public string ref_id { get; set; }
+ public string upnp_class { get; set; }
+ public uint64 modified { get; set; }
+ public uint object_update_id { get; set; }
+
+ //TODO: { get; private set; } or, even better,
+ // add virtual set_uri in Object and make add_uri() in Item into set_uri()
+ // and make the uri property single-value.
public Gee.ArrayList<string> uris;
// You can keep both a unowned and owned ref to parent of this MediaObject.
// In most cases, one will only need to keep an unowned ref to avoid cyclic
- // references since usually parent container will keep refs to child items.
- // However in some cases, one only wants the parent to exist as long as the
- // child exists and it is in those cases, you will want to use 'parent_ref'.
+ // references since usually the parent container will keep refs to child items.
+ // However, in some cases, one only wants the parent to exist as long as the
+ // child exists and it is in those cases that you will want to use 'parent_ref'.
//
// You must set 'parent' if you set 'parent_ref' but the opposite is not
// mandatory.
- public unowned MediaContainer parent;
+ public unowned MediaContainer parent; // TODO: Turn this into a property?
private MediaContainer _parent_ref;
public MediaContainer parent_ref {
get {