[rygel] core: Make use of mime-type in item creation requests
- From: Zeeshan Ali Khattak <zeeshanak src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [rygel] core: Make use of mime-type in item creation requests
- Date: Fri, 13 Aug 2010 14:09:11 +0000 (UTC)
commit 87b0e920098fbd1edf957d34c554a93cdc9aced3
Author: Zeeshan Ali (Khattak) <zeeshanak gnome org>
Date: Fri Aug 13 17:07:22 2010 +0300
core: Make use of mime-type in item creation requests
If mime-type is provided in item creation request, there is no need
to guess it. Just use the one provided.
src/rygel/rygel-item-creator.vala | 15 ++++++++++++---
1 files changed, 12 insertions(+), 3 deletions(-)
---
diff --git a/src/rygel/rygel-item-creator.vala b/src/rygel/rygel-item-creator.vala
index 6d09859..1e66853 100644
--- a/src/rygel/rygel-item-creator.vala
+++ b/src/rygel/rygel-item-creator.vala
@@ -75,16 +75,25 @@ internal class Rygel.ItemCreator: GLib.Object, Rygel.StateMachine {
container,
didl_item.title,
didl_item.upnp_class);
- this.item.mime_type = this.get_generic_mime_type ();
var resources = didl_item.get_resources ();
if (resources != null) {
var info = resources.nth (0).data.protocol_info;
- if (info != null && info.dlna_profile != null) {
- this.item.dlna_profile = info.dlna_profile;
+ if (info != null) {
+ if (info.dlna_profile != null) {
+ this.item.dlna_profile = info.dlna_profile;
+ }
+
+ if (info.mime_type != null) {
+ this.item.mime_type = info.mime_type;
+ }
}
}
+ if (item.mime_type == null) {
+ this.item.mime_type = this.get_generic_mime_type ();
+ }
+
this.item.place_holder = true;
yield container.add_item (this.item, this.cancellable);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]