[rygel] server: Remove obsolete code



commit 0799ef8795de31a23607cad5732a2a2605601b3f
Author: Jens Georg <mail jensge org>
Date:   Fri Feb 13 12:41:36 2015 +0100

    server: Remove obsolete code

 src/librygel-server/rygel-audio-item.vala      |    4 -
 src/librygel-server/rygel-http-get.vala        |   46 +--------------
 src/librygel-server/rygel-image-item.vala      |    4 -
 src/librygel-server/rygel-media-file-item.vala |   75 ------------------------
 src/librygel-server/rygel-media-object.vala    |   11 ----
 src/librygel-server/rygel-playlist-item.vala   |    4 -
 src/librygel-server/rygel-video-item.vala      |    4 -
 7 files changed, 3 insertions(+), 145 deletions(-)
---
diff --git a/src/librygel-server/rygel-audio-item.vala b/src/librygel-server/rygel-audio-item.vala
index 0495ecc..88ff0cd 100644
--- a/src/librygel-server/rygel-audio-item.vala
+++ b/src/librygel-server/rygel-audio-item.vala
@@ -75,10 +75,6 @@ public class Rygel.AudioItem : MediaFileItem {
                 upnp_class : upnp_class);
     }
 
-    public override bool streamable () {
-        return true;
-    }
-
     internal override void apply_didl_lite (DIDLLiteObject didl_object) {
         base.apply_didl_lite (didl_object);
 
diff --git a/src/librygel-server/rygel-http-get.vala b/src/librygel-server/rygel-http-get.vala
index 79adfbb..6230f38 100644
--- a/src/librygel-server/rygel-http-get.vala
+++ b/src/librygel-server/rygel-http-get.vala
@@ -35,11 +35,6 @@ public class Rygel.HTTPGet : HTTPRequest {
     private const string TRANSFER_MODE_HEADER = "transferMode.dlna.org";
 
     public HTTPSeekRequest seek;
-    public Thumbnail thumbnail;
-    public Subtitle subtitle;
-
-    private int thumbnail_index;
-    private int subtitle_index;
 
     public HTTPGetHandler handler;
 
@@ -47,9 +42,6 @@ public class Rygel.HTTPGet : HTTPRequest {
                     Soup.Server  server,
                     Soup.Message msg) {
         base (http_server, server, msg);
-
-        this.thumbnail_index = -1;
-        this.subtitle_index = -1;
     }
 
     protected override async void handle () throws Error {
@@ -80,6 +72,9 @@ public class Rygel.HTTPGet : HTTPRequest {
             this.handler = new HTTPSubtitleHandler (this.object as MediaFileItem,
                                                     uri.subtitle_index,
                                                     this.cancellable);
+        } else {
+            throw new HTTPRequestError.NOT_FOUND ("No handler found for '%s'",
+                                                  uri.to_string ());
         }
 
         { // Check the transfer mode
@@ -115,41 +110,6 @@ public class Rygel.HTTPGet : HTTPRequest {
         if (this.hack != null) {
             this.hack.apply (this.object);
         }
-
-        if (this.uri.thumbnail_index >= 0) {
-            if (this.object is MusicItem) {
-                var music = this.object as MusicItem;
-                this.thumbnail = music.album_art;
-
-                return;
-            } else if (this.object is VisualItem) {
-                var visual = this.object as VisualItem;
-                if (this.uri.thumbnail_index < visual.thumbnails.size) {
-                    this.thumbnail = visual.thumbnails.get
-                                            (this.uri.thumbnail_index);
-
-                    return;
-                }
-            }
-
-            throw new HTTPRequestError.NOT_FOUND
-                                        ("No Thumbnail available for item '%s",
-                                         this.object.id);
-        }
-
-        if (this.uri.subtitle_index >= 0 && this.object is VideoItem) {
-            var video = this.object as VideoItem;
-
-            if (this.uri.subtitle_index < video.subtitles.size) {
-                this.subtitle = video.subtitles.get (this.uri.subtitle_index);
-
-                return;
-            }
-
-            throw new HTTPRequestError.NOT_FOUND
-                                        ("No subtitles available for item '%s",
-                                         this.object.id);
-        }
     }
 
     private async void handle_item_request () throws Error {
diff --git a/src/librygel-server/rygel-image-item.vala b/src/librygel-server/rygel-image-item.vala
index 83e136b..29dc17e 100644
--- a/src/librygel-server/rygel-image-item.vala
+++ b/src/librygel-server/rygel-image-item.vala
@@ -77,10 +77,6 @@ public class Rygel.ImageItem : MediaFileItem, VisualItem {
         this.thumbnails = new ArrayList<Thumbnail> ();
     }
 
-    public override bool streamable () {
-        return false;
-    }
-
     public override void add_uri (string uri) {
         base.add_uri (uri);
 
diff --git a/src/librygel-server/rygel-media-file-item.vala b/src/librygel-server/rygel-media-file-item.vala
index d0ab538..eca2393 100644
--- a/src/librygel-server/rygel-media-file-item.vala
+++ b/src/librygel-server/rygel-media-file-item.vala
@@ -151,51 +151,6 @@ public abstract class Rygel.MediaFileItem : MediaItem {
                                         (this, resource);
     }
 
-    public bool is_live_stream () {
-        return this.streamable () && this.size <= 0;
-    }
-
-    public abstract bool streamable ();
-
-    internal override DIDLLiteResource add_resource
-                                        (DIDLLiteObject didl_object,
-                                         string?        uri,
-                                         string         protocol,
-                                         string?        import_uri = null)
-                                         throws Error {
-        var res = base.add_resource (didl_object,
-                                     uri,
-                                     protocol,
-                                     import_uri);
-
-        if (uri != null && !this.place_holder) {
-            res.uri = uri;
-        } else {
-            // Set empty string otherwise gupnp-av (libxml actually) will add
-            // a self-enclosing node in the DIDL-Lite which is not very much
-            // appreciated by UPnP devices using crappy XML parsers.
-            res.uri = "";
-        }
-
-        if (import_uri != null && this.place_holder) {
-            res.import_uri = import_uri;
-        }
-
-        if (this is TrackableItem) {
-            // This is attribute is mandatory for track changes
-            // implementation. We don't really support updating the resources
-            // so we just set it to 0.
-            res.update_count = 0;
-        }
-
-        res.size64 = this.size;
-
-        /* Protocol info */
-        res.protocol_info = this.get_protocol_info (uri, protocol);
-
-        return res;
-    }
-
     internal override DIDLLiteObject? serialize (Serializer serializer,
                                                  HTTPServer http_server)
                                                  throws Error {
@@ -303,36 +258,6 @@ public abstract class Rygel.MediaFileItem : MediaItem {
     }
 
 
-    protected override ProtocolInfo get_protocol_info (string? uri,
-                                                       string  protocol) {
-        var protocol_info = base.get_protocol_info (uri, protocol);
-
-        protocol_info.mime_type = this.mime_type;
-        protocol_info.dlna_profile = this.dlna_profile;
-
-        if (this.size > 0) {
-            protocol_info.dlna_operation = DLNAOperation.RANGE;
-        }
-
-        if (this.streamable ()) {
-            protocol_info.dlna_flags |= DLNAFlags.STREAMING_TRANSFER_MODE;
-        }
-
-        return protocol_info;
-    }
-
-    protected virtual void add_resources (DIDLLiteItem didl_item,
-                                          bool         allow_internal)
-                                          throws Error {
-        foreach (var uri in this.get_uris ()) {
-            var protocol = this.get_protocol_for_uri (uri);
-
-            if (allow_internal || protocol != "internal") {
-                this.add_resource (didl_item, uri, protocol);
-            }
-        }
-    }
-
     /**
      * Subclasses can override this method to augment the MediaObject MediaResource
      * list with secondary MediaResource objects representing derivative resources.
diff --git a/src/librygel-server/rygel-media-object.vala b/src/librygel-server/rygel-media-object.vala
index 8dde001..2eb9279 100644
--- a/src/librygel-server/rygel-media-object.vala
+++ b/src/librygel-server/rygel-media-object.vala
@@ -389,17 +389,6 @@ public abstract class Rygel.MediaObject : GLib.Object {
         }
     }
 
-    internal virtual DIDLLiteResource add_resource
-                                        (DIDLLiteObject object,
-                                         string?        uri,
-                                         string         protocol,
-                                         string?        import_uri = null)
-                                         throws Error {
-        var res = object.add_resource ();
-
-        return res;
-    }
-
     protected int compare_int_props (int prop1, int prop2) {
         return (prop1 - prop2).clamp (-1, 1);
     }
diff --git a/src/librygel-server/rygel-playlist-item.vala b/src/librygel-server/rygel-playlist-item.vala
index 8306d92..579242b 100644
--- a/src/librygel-server/rygel-playlist-item.vala
+++ b/src/librygel-server/rygel-playlist-item.vala
@@ -40,10 +40,6 @@ public class Rygel.PlaylistItem : MediaFileItem {
                 upnp_class : upnp_class);
     }
 
-    public override bool streamable () {
-        return false;
-    }
-
     internal override DIDLLiteObject? serialize (Serializer serializer,
                                                  HTTPServer http_server)
                                                  throws Error {
diff --git a/src/librygel-server/rygel-video-item.vala b/src/librygel-server/rygel-video-item.vala
index f49df80..d80da39 100644
--- a/src/librygel-server/rygel-video-item.vala
+++ b/src/librygel-server/rygel-video-item.vala
@@ -82,10 +82,6 @@ public class Rygel.VideoItem : AudioItem, VisualItem {
         this.subtitles = new ArrayList<Subtitle> ();
     }
 
-    public override bool streamable () {
-        return true;
-    }
-
     public override void add_uri (string uri) {
         base.add_uri (uri);
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]