#include "gupnp-media-server.h"
+#define HOME_DIR_ALIAS "/media"
+
G_DEFINE_TYPE (GUPnPMediaServer,
gupnp_media_server,
GUPNP_TYPE_ROOT_DEVICE);
GUPnPSearchCriteriaParser *search_parser;
};
-/* Hard-coded items (mime, title, path) */
+/* Hard-coded items (mime, title, path)
+ *
+ * paths are relative to home directory
+ * */
char *items[3][4] = {
{ "4000",
"audio/mpeg",
"Maa",
- "/home/zeenix/entertainment/songs/Maa.mp3" },
+ "entertainment/songs/Maa.mp3" },
{ "4001",
"audio/mpeg",
"Hoo",
- "/home/zeenix/entertainment/songs/Ho.mp3" },
+ "entertainment/songs/Ho.mp3" },
{ NULL }
};
GObjectClass *object_class;
GUPnPMediaServer *server;
GUPnPServiceInfo *service;
+ GUPnPContext *context;
object_class = G_OBJECT_CLASS (gupnp_media_server_parent_class);
object = object_class->constructor (type,
}
}
+ context = gupnp_device_info_get_context (GUPNP_DEVICE_INFO (server));
+
+ /* Host user's home dir */
+ gupnp_context_host_path (context, g_get_home_dir (), HOME_DIR_ALIAS);
+
return object;
}
gupnp_didl_lite_resource_reset (&res);
/* URI */
- res.uri = g_strdup_printf ("http://%s:%d%s",
+ res.uri = g_strdup_printf ("http://%s:%d%s/%s",
gupnp_context_get_host_ip (context),
gupnp_context_get_port (context),
+ HOME_DIR_ALIAS,
path);
/* Protocol info */