[rygel] server: Style fixes



commit fcf89363783f4f14773cfcd4f9f322355769d0e8
Author: Jens Georg <mail jensge org>
Date:   Mon Mar 16 09:06:07 2015 +0100

    server: Style fixes
    
    Signed-off-by: Jens Georg <mail jensge org>

 src/librygel-server/rygel-content-directory.vala   |    6 +-
 src/librygel-server/rygel-data-sink.vala           |   20 ++-
 src/librygel-server/rygel-data-source.vala         |   28 +++--
 src/librygel-server/rygel-dbus-thumbnailer.vala    |    6 +
 .../rygel-dlna-available-seek-request.vala         |   31 ++---
 .../rygel-dlna-available-seek-response.vala        |   57 ++++-----
 .../rygel-dtcp-cleartext-request.vala              |   84 +++++++------
 .../rygel-dtcp-cleartext-response.vala             |   35 +++---
 .../rygel-http-byte-seek-request.vala              |   44 ++++---
 .../rygel-http-byte-seek-response.vala             |   17 ++-
 src/librygel-server/rygel-http-get-handler.vala    |   12 +-
 src/librygel-server/rygel-http-get.vala            |  100 +++++++++------
 .../rygel-http-response-element.vala               |   12 --
 src/librygel-server/rygel-http-server.vala         |    6 +-
 .../rygel-http-subtitle-handler.vala               |   23 ++--
 .../rygel-http-thumbnail-handler.vala              |   24 +++--
 .../rygel-http-time-seek-request.vala              |   81 ++++++++-----
 .../rygel-http-time-seek-response.vala             |  133 +++++++++++---------
 src/librygel-server/rygel-image-item.vala          |    9 +-
 src/librygel-server/rygel-import-resource.vala     |   11 +-
 src/librygel-server/rygel-last-change-obj-add.vala |    3 +-
 src/librygel-server/rygel-last-change-obj-del.vala |    3 +-
 src/librygel-server/rygel-last-change-obj-mod.vala |    3 +-
 src/librygel-server/rygel-last-change-st-done.vala |    3 +-
 src/librygel-server/rygel-media-container.vala     |   12 +-
 src/librygel-server/rygel-media-file-item.vala     |   45 ++++---
 src/librygel-server/rygel-media-object.vala        |   32 ++++--
 src/librygel-server/rygel-media-query-action.vala  |    2 +-
 src/librygel-server/rygel-media-resource.vala      |  129 ++++++++++---------
 src/librygel-server/rygel-media-server-plugin.vala |    4 +-
 src/librygel-server/rygel-music-item.vala          |    3 +-
 .../rygel-object-removal-queue.vala                |    2 +-
 src/librygel-server/rygel-panasonic-hacks.vala     |    4 +
 src/librygel-server/rygel-playspeed-request.vala   |   40 +++----
 src/librygel-server/rygel-playspeed-response.vala  |   30 ++---
 src/librygel-server/rygel-playspeed.vala           |   34 ++---
 src/librygel-server/rygel-simple-container.vala    |    5 +-
 src/librygel-server/rygel-subtitle-manager.vala    |   21 ++-
 src/librygel-server/rygel-thumbnail.vala           |    3 +-
 src/librygel-server/rygel-trackable-container.vala |    2 +-
 src/librygel-server/rygel-video-item.vala          |    9 +-
 src/librygel-server/rygel-visual-item.vala         |    4 +-
 src/librygel-server/rygel-xbox-hacks.vala          |    2 +-
 43 files changed, 626 insertions(+), 508 deletions(-)
---
diff --git a/src/librygel-server/rygel-content-directory.vala 
b/src/librygel-server/rygel-content-directory.vala
index 20bf25a..43c5727 100644
--- a/src/librygel-server/rygel-content-directory.vala
+++ b/src/librygel-server/rygel-content-directory.vala
@@ -648,8 +648,7 @@ public class Rygel.ContentDirectory: Service {
         value.set_string (this.last_change.get_log ());
     }
 
-    private void ensure_timeout ()
-    {
+    private void ensure_timeout () {
         if (this.update_notify_id == 0) {
             this.update_notify_id = Timeout.add (200, this.update_notify);
         }
@@ -657,8 +656,7 @@ public class Rygel.ContentDirectory: Service {
 
     private void add_last_change_entry (MediaObject object,
                                         ObjectEventType event_type,
-                                        bool sub_tree_update)
-    {
+                                        bool sub_tree_update) {
         LastChangeEntry entry;
 
         switch (event_type) {
diff --git a/src/librygel-server/rygel-data-sink.vala b/src/librygel-server/rygel-data-sink.vala
index eb206ed..02de116 100644
--- a/src/librygel-server/rygel-data-sink.vala
+++ b/src/librygel-server/rygel-data-sink.vala
@@ -49,12 +49,7 @@ internal class Rygel.DataSink : Object {
 
         this.chunks_buffered = 0;
         this.bytes_sent = 0;
-        this.max_bytes = int64.MAX;
-        if (offsets != null &&
-            offsets is HTTPByteSeekRequest &&
-            ((offsets as HTTPByteSeekRequest).range_length != HTTPSeekRequest.UNSPECIFIED)) {
-            this.max_bytes = (offsets as HTTPByteSeekRequest).range_length;
-        }
+        this.max_bytes = this.get_max_bytes (offsets);
         debug ("Setting max_bytes to %s", (this.max_bytes == int64.MAX)
                                           ? "MAX" : this.max_bytes.to_string());
         this.source.data_available.connect (this.on_data_available);
@@ -88,4 +83,17 @@ internal class Rygel.DataSink : Object {
             this.source.freeze ();
         }
     }
+
+    private int64 get_max_bytes (HTTPSeekRequest? offsets) {
+        if (offsets == null || !(offsets is HTTPByteSeekRequest)) {
+            debug ("Setting max_bytes to MAX");
+
+            return int64.MAX;
+        }
+
+        var request = offsets as HTTPByteSeekRequest;
+        debug ("Setting max_bytes to %lld", request.range_length);
+
+        return request.range_length;
+    }
 }
diff --git a/src/librygel-server/rygel-data-source.vala b/src/librygel-server/rygel-data-source.vala
index 8937fc4..2141100 100644
--- a/src/librygel-server/rygel-data-source.vala
+++ b/src/librygel-server/rygel-data-source.vala
@@ -65,22 +65,26 @@ public interface Rygel.DataSource : GLib.Object {
      * Preroll the data with the given seek and playspeed.
      *
      * @param seek    optional seek/range specifier
-     * @param playspeed optional playback rate specifier. This will only be provided
-     *                  when a scaled rate is requested (the speed will not be 0.0 or 1.0)
+     * @param playspeed optional playback rate specifier. This will only be
+     *                  provided when a scaled rate is requested (the speed
+     *                  will not be 0.0 or 1.0)
      *
-     * @return List of HTTPResponseElements appropriate for the content request and
-     *         optional seek/playspeed (e.g. Content-Range, TimeSeekRange.dlna.org,
-     *         etc) or null/empty list if none are appropriate. Note: the list will
-     *         be processed in-order by the caller.
+     * @return List of HTTPResponseElements appropriate for the content request
+     *         and optional seek/playspeed (e.g. Content-Range,
+     *         TimeSeekRange.dlna.org, etc) or null/empty list if none are
+     *         appropriate. Note: the list will be processed in-order by the
+     *         caller.
      *
      * @throws Error if anything goes wrong while prerolling the stream.
-     *         Throws DataSourceError.SEEK_FAILED if a seek method is not supported or the
-     *         range is not fulfillable.
-     *         Throws PLAYSPEED_FAILED if the rate is not supported or fulfillable.
+     *         Throws DataSourceError.SEEK_FAILED if a seek method is not
+     *         supported or the range is not fulfillable.
+     *         Throws PLAYSPEED_FAILED if the rate is not supported or
+     *         fulfillable.
      */
-    public abstract Gee.List<HTTPResponseElement> ? preroll (HTTPSeekRequest? seek,
-                                                             PlaySpeedRequest? playspeed)
-       throws Error;
+    public abstract Gee.List<HTTPResponseElement>? preroll
+                                        (HTTPSeekRequest? seek,
+                                         PlaySpeedRequest? playspeed)
+                                         throws Error;
 
     /**
      * Start producing the data.
diff --git a/src/librygel-server/rygel-dbus-thumbnailer.vala b/src/librygel-server/rygel-dbus-thumbnailer.vala
index f2f174c..f3c6765 100644
--- a/src/librygel-server/rygel-dbus-thumbnailer.vala
+++ b/src/librygel-server/rygel-dbus-thumbnailer.vala
@@ -116,7 +116,13 @@ internal class Rygel.DbusThumbnailer : GLib.Object {
                 debug (_("No D-Bus thumbnailer service available"));
             }
         } catch (DBusError error) {
+            debug ("DBus error while trying to connect to thumbmailer service:"
+                   + " %s",
+                   error.message);
         } catch (IOError io_error) {
+            debug ("I/O error while trying to connect to thumbmailer service:"
+                   + " %s",
+                   io_error.message);
         }
 
         this.ready (this.tumbler != null);
diff --git a/src/librygel-server/rygel-dlna-available-seek-request.vala 
b/src/librygel-server/rygel-dlna-available-seek-request.vala
index 433bc57..cddb452 100644
--- a/src/librygel-server/rygel-dlna-available-seek-request.vala
+++ b/src/librygel-server/rygel-dlna-available-seek-request.vala
@@ -14,18 +14,6 @@
  * You should have received a copy of the GNU Lesser General Public License
  * along with this program; if not, write to the Free Software Foundation,
  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
- * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
- * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL CABLE TELEVISION LABORATORIES
- * INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
- * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
- * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
- * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
 public static const string GET_AVAILABLE_SEEK_RANGE_HEADER = "getAvailableSeekRange.dlna.org";
@@ -37,8 +25,8 @@ public static const string GET_AVAILABLE_SEEK_RANGE_HEADER = "getAvailableSeekRa
  */
 public class Rygel.DLNAAvailableSeekRangeRequest : Rygel.HTTPSeekRequest {
     /**
-     * Create a DLNAAvailableSeekRangeRequest corresponding with a HTTPGet that contains a
-     * getAvailableSeekRange.dlna.org header value.
+     * Create a DLNAAvailableSeekRangeRequest corresponding with a HTTPGet
+     * that contains a getAvailableSeekRange.dlna.org header value.
      *
      * @param request The HTTP GET/HEAD request
      */
@@ -46,16 +34,19 @@ public class Rygel.DLNAAvailableSeekRangeRequest : Rygel.HTTPSeekRequest {
             throws HTTPSeekRequestError {
         base ();
 
-        var params = request.msg.request_headers.get_one (GET_AVAILABLE_SEEK_RANGE_HEADER);
+        var params = request.msg.request_headers.get_one
+                                        (GET_AVAILABLE_SEEK_RANGE_HEADER);
 
         if (params == null) {
-            throw new HTTPSeekRequestError.BAD_REQUEST ("%s not present",
-                                                        GET_AVAILABLE_SEEK_RANGE_HEADER);
+            throw new HTTPSeekRequestError.BAD_REQUEST
+                                        ("%s not present",
+                                         GET_AVAILABLE_SEEK_RANGE_HEADER);
         }
         if (params.strip () != "1") {
-            throw new HTTPSeekRequestError.BAD_REQUEST ("%s != 1 (found \"%s\")",
-                                                        GET_AVAILABLE_SEEK_RANGE_HEADER,
-                                                        params);
+            throw new HTTPSeekRequestError.BAD_REQUEST
+                                        ("%s != 1 (found \"%s\")",
+                                         GET_AVAILABLE_SEEK_RANGE_HEADER,
+                                         params);
         }
     }
 
diff --git a/src/librygel-server/rygel-dlna-available-seek-response.vala 
b/src/librygel-server/rygel-dlna-available-seek-response.vala
index 5c9dc8f..016c0a1 100644
--- a/src/librygel-server/rygel-dlna-available-seek-response.vala
+++ b/src/librygel-server/rygel-dlna-available-seek-response.vala
@@ -14,18 +14,6 @@
  * You should have received a copy of the GNU Lesser General Public License
  * along with this program; if not, write to the Free Software Foundation,
  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
- * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
- * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL CABLE TELEVISION LABORATORIES
- * INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
- * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
- * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
- * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
 public static const string AVAILABLE_SEEK_RANGE_HEADER = "availableSeekRange.dlna.org";
@@ -61,8 +49,11 @@ public class Rygel.DLNAAvailableSeekRangeResponse : Rygel.HTTPResponseElement {
      */
     public int64 range_length { get; private set; }
 
-    public DLNAAvailableSeekRangeResponse (int mode, int64 start_time, int64 end_time,
-                                           int64 start_byte, int64 end_byte) {
+    public DLNAAvailableSeekRangeResponse (int mode,
+                                           int64 start_time,
+                                           int64 end_time,
+                                           int64 start_byte,
+                                           int64 end_byte) {
         base ();
         this.mode = mode;
         this.start_time = start_time;
@@ -72,7 +63,9 @@ public class Rygel.DLNAAvailableSeekRangeResponse : Rygel.HTTPResponseElement {
         this.range_length = end_byte - start_byte + 1;
     }
 
-    public DLNAAvailableSeekRangeResponse.time_only (int mode, int64 start_time, int64 end_time) {
+    public DLNAAvailableSeekRangeResponse.time_only (int mode,
+                                                     int64 start_time,
+                                                     int64 end_time) {
         base ();
         this.mode = mode;
         this.start_time = start_time;
@@ -81,9 +74,10 @@ public class Rygel.DLNAAvailableSeekRangeResponse : Rygel.HTTPResponseElement {
     }
 
     public override void add_response_headers (Rygel.HTTPRequest request) {
-        var response = get_response_string ();
+        var response = this.get_response_string ();
         if (response != null) {
-            request.msg.response_headers.append (AVAILABLE_SEEK_RANGE_HEADER, response);
+            request.msg.response_headers.append (AVAILABLE_SEEK_RANGE_HEADER,
+                                                 response);
         }
     }
 
@@ -94,24 +88,28 @@ public class Rygel.DLNAAvailableSeekRangeResponse : Rygel.HTTPResponseElement {
 
         // The availableSeekRange format:
         //
-        // availableSeekRange.dlna.org: MODE npt=START_TIME-END_TIME bytes=START_BYTE-END_BYTE
+        // availableSeekRange.dlna.org:
+        // MODE npt=START_TIME-END_TIME bytes=START_BYTE-END_BYTE
         //
-        // The MODE can be either "0" or "1", indicating the limited operation mode being
-        //  used by the server.
+        // The MODE can be either "0" or "1", indicating the limited operation
+        // mode being used by the server.
         //
-        // The "bytes=" field can be ommitted in some cases. (e.g. ORG_OP b-val==0 and
-        // lop-bytes is 0).
+        // The "bytes=" field can be ommitted in some cases. (e.g. ORG_OP
+        // b-val==0 and lop-bytes is 0).
 
-        // It's not our job at this level to enforce all the semantics of the availableSeekRange
-        //  response, as we don't have enough context. Setting up the correct HTTPTimeSeekRequest
-        //  object is the responsibility of the object owner. To form the response, we just
-        //  use what is set.
+        // It's not our job at this level to enforce all the semantics of the
+        // availableSeekRange response, as we don't have enough context.
+        // Setting up the correct HTTPTimeSeekRequest object is the
+        // responsibility of the object owner. To form the response, we just
+        // use what is set.
 
         var response = new StringBuilder ();
         response.append (mode.to_string ());
         response.append (" npt=");
-        response.append_printf ("%.3f-", (double) this.start_time / TimeSpan.SECOND);
-        response.append_printf ("%.3f", (double) this.end_time / TimeSpan.SECOND);
+        response.append_printf ("%.3f-",
+                                (double) this.start_time / TimeSpan.SECOND);
+        response.append_printf ("%.3f",
+                                (double) this.end_time / TimeSpan.SECOND);
 
         if (this.start_byte != UNSPECIFIED) {
             response.append (" bytes=");
@@ -124,6 +122,7 @@ public class Rygel.DLNAAvailableSeekRangeResponse : Rygel.HTTPResponseElement {
    }
 
     public override string to_string () {
-        return ("HTTPTimeSeekResponse (%s)".printf (get_response_string ()));
+        return ("HTTPTimeSeekResponse (%s)".printf
+                                        (this.get_response_string ()));
     }
 }
diff --git a/src/librygel-server/rygel-dtcp-cleartext-request.vala 
b/src/librygel-server/rygel-dtcp-cleartext-request.vala
index c116c7f..7ac6e8b 100644
--- a/src/librygel-server/rygel-dtcp-cleartext-request.vala
+++ b/src/librygel-server/rygel-dtcp-cleartext-request.vala
@@ -13,18 +13,6 @@
  * You should have received a copy of the GNU Lesser General Public License
  * along with this program; if not, write to the Free Software Foundation,
  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
- * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
- * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL CABLE TELEVISION LABORATORIES
- * INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
- * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
- * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
- * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
 using GUPnP;
@@ -38,17 +26,20 @@ public class Rygel.DTCPCleartextRequest : Rygel.HTTPSeekRequest {
     public int64 start_byte { get; private set; }
 
     /**
-     * The end of the cleartext range in bytes (inclusive). May be HTTPSeekRequest.UNSPECIFIED
+     * The end of the cleartext range in bytes (inclusive). May be
+     * HTTPSeekRequest.UNSPECIFIED
      */
     public int64 end_byte { get; private set; }
 
     /**
-     * The length of the cleartext range in bytes. May be HTTPSeekRequest.UNSPECIFIED
+     * The length of the cleartext range in bytes. May be
+     * HTTPSeekRequest.UNSPECIFIED
      */
     public int64 range_length { get; private set; }
 
     /**
-     * The length of the cleartext resource in bytes. May be HTTPSeekRequest.UNSPECIFIED
+     * The length of the cleartext resource in bytes. May be
+     * HTTPSeekRequest.UNSPECIFIED
      */
     public int64 total_size { get; private set; }
 
@@ -61,40 +52,47 @@ public class Rygel.DTCPCleartextRequest : Rygel.HTTPSeekRequest {
         // It's only possible to get the cleartext size from a MediaResource
         //  (and only if it is link protected)
         if (request.handler is HTTPMediaResourceHandler) {
-            MediaResource resource = (request.handler as HTTPMediaResourceHandler)
-                                     .media_resource;
+            var resource = (request.handler as HTTPMediaResourceHandler)
+                                        .media_resource;
             total_size = resource.cleartext_size;
             if (total_size <= 0) {
-                // Even if it's a resource and the content is link-protected, it may have an
-                // unknown cleartext size (e.g. if it's live/in-progress content). This doesn't
-                // mean the request is invalid, it just means the total size is non-static
+                // Even if it's a resource and the content is link-protected,
+                // it may have an unknown cleartext size (e.g. if it's
+                // live/in-progress content). This doesn't mean the request is
+                // invalid, it just means the total size is non-static
                 total_size = UNSPECIFIED;
             }
         } else {
             total_size = UNSPECIFIED;
         }
 
-        unowned string range = request.msg.request_headers.get_one (DTCP_RANGE_HEADER);
+        unowned string range = request.msg.request_headers.get_one
+                                        (DTCP_RANGE_HEADER);
 
         if (range == null) {
-            throw new HTTPSeekRequestError.INVALID_RANGE ( "%s request header not present",
-                                                           DTCP_RANGE_HEADER );
+            var msg = ("%s request header not present");
+            throw new HTTPSeekRequestError.INVALID_RANGE (msg,
+                                                          DTCP_RANGE_HEADER);
         }
 
         if (!range.has_prefix ("bytes")) {
-            throw new HTTPSeekRequestError.INVALID_RANGE ( "Invalid %s value (missing bytes field): '%s'",
-                                                           DTCP_RANGE_HEADER, range );
+            var msg = ("Invalid %s value (missing bytes field): '%s'");
+            throw new HTTPSeekRequestError.INVALID_RANGE (msg,
+                                                          DTCP_RANGE_HEADER,
+                                                          range);
         }
 
         var range_tokens = range.substring (6).split ("-", 2); // skip "bytes="
         if (range_tokens[0].length == 0) {
-            throw new HTTPSeekRequestError.INVALID_RANGE ( "No range start specified: '%s'",
-                                                           range );
+            var msg = "No range start specified: '%s'";
+            throw new HTTPSeekRequestError.INVALID_RANGE (msg, range);
         }
 
         if (!int64.try_parse (range_tokens[0], out start) || (start < 0)) {
-            throw new HTTPSeekRequestError.INVALID_RANGE ( "Invalid %s range start: '%s'",
-                                                           DTCP_RANGE_HEADER, range );
+            var msg = "Invalid %s range start: '%s'";
+            throw new HTTPSeekRequestError.INVALID_RANGE (msg,
+                                                          DTCP_RANGE_HEADER,
+                                                          range);
         }
         // valid range start specified
 
@@ -103,33 +101,41 @@ public class Rygel.DTCPCleartextRequest : Rygel.HTTPSeekRequest {
             end = UNSPECIFIED;
         } else {
             if (!int64.try_parse (range_tokens[1], out end) || (end <= 0)) {
-                throw new HTTPSeekRequestError.INVALID_RANGE ( "Invalid %s range end: '%s'",
-                                                               DTCP_RANGE_HEADER, range );
+                var msg = "Invalid %s range end: '%s'";
+                throw new HTTPSeekRequestError.INVALID_RANGE (msg,
+                                                              DTCP_RANGE_HEADER,
+                                                              range);
             }
             // valid end range specified
         }
 
         if ((end != UNSPECIFIED) && (start > end)) {
-            throw new HTTPSeekRequestError.INVALID_RANGE ( "Invalid %s range - start > end: '%s'",
-                                                           DTCP_RANGE_HEADER, range );
+            var msg = "Invalid %s range - start > end: '%s'";
+            throw new HTTPSeekRequestError.INVALID_RANGE (msg,
+                                                          DTCP_RANGE_HEADER,
+                                                          range);
         }
 
         if ((total_size != UNSPECIFIED) && (start > total_size-1)) {
-            throw new HTTPSeekRequestError.OUT_OF_RANGE ( "Invalid %s range - start > length: '%s'",
-                                                           DTCP_RANGE_HEADER, range );
+            var msg = "Invalid %s range - start > length: '%s'";
+            throw new HTTPSeekRequestError.OUT_OF_RANGE (msg,
+                                                         DTCP_RANGE_HEADER,
+                                                         range);
         }
 
         if ((total_size != UNSPECIFIED) && (end > total_size-1)) {
-            // It's not clear from the DLNA link protection spec if the range end can be beyond
-            //  the total length. We'll assume RFC 2616 14.35.1 semantics. But note that having
-            //  an end with an unspecified size will be normal for live/in-progress content
+            // It's not clear from the DLNA link protection spec if the range
+            // end can be beyond the total length. We'll assume RFC 2616
+            // 14.35.1 semantics. But note that having an end with an
+            // unspecified size will be normal for live/in-progress content
             end = total_size-1;
         }
 
         this.start_byte = start;
         this.end_byte = end;
+        // +1, since range is inclusive
         this.range_length = (end == UNSPECIFIED) ? UNSPECIFIED
-                                                : end-start+1; // +1, since range is inclusive
+                                                 : end - start + 1;
         this.total_size = total_size;
     }
 
diff --git a/src/librygel-server/rygel-dtcp-cleartext-response.vala 
b/src/librygel-server/rygel-dtcp-cleartext-response.vala
index 91d055c..6e732dd 100644
--- a/src/librygel-server/rygel-dtcp-cleartext-response.vala
+++ b/src/librygel-server/rygel-dtcp-cleartext-response.vala
@@ -13,24 +13,12 @@
  * You should have received a copy of the GNU Lesser General Public License
  * along with this program; if not, write to the Free Software Foundation,
  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
- * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
- * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL CABLE TELEVISION LABORATORIES
- * INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
- * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
- * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
- * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
 using GUPnP;
 
 public class Rygel.DTCPCleartextResponse : Rygel.HTTPResponseElement {
-    public static const string DTCP_CONTENT_RANGE_HEADER = "Content-Range.dtcp.com";
+    public const string DTCP_CONTENT_RANGE_HEADER = "Content-Range.dtcp.com";
 
     /**
      * The start of the response range in bytes
@@ -57,7 +45,9 @@ public class Rygel.DTCPCleartextResponse : Rygel.HTTPResponseElement {
      */
     public int64 encrypted_length { get; public set;}
 
-    public DTCPCleartextResponse (int64 start_byte, int64 end_byte, int64 total_size,
+    public DTCPCleartextResponse (int64 start_byte,
+                                  int64 end_byte,
+                                  int64 total_size,
                                   int64 encrypted_length = UNSPECIFIED) {
         this.start_byte = start_byte;
         this.end_byte = end_byte;
@@ -66,8 +56,9 @@ public class Rygel.DTCPCleartextResponse : Rygel.HTTPResponseElement {
         this.encrypted_length = encrypted_length;
     }
 
-    public DTCPCleartextResponse.from_request (DTCPCleartextRequest request,
-                                               int64 encrypted_length = UNSPECIFIED) {
+    public DTCPCleartextResponse.from_request
+                                        (DTCPCleartextRequest request,
+                                         int64 encrypted_length = UNSPECIFIED) {
         this.start_byte = request.start_byte;
         this.end_byte = request.end_byte;
         this.range_length = request.range_length;
@@ -83,15 +74,21 @@ public class Rygel.DTCPCleartextResponse : Rygel.HTTPResponseElement {
                               + ( (this.total_size == UNSPECIFIED) ? "*"
                                   : this.total_size.to_string () );
 
-            request.msg.response_headers.append (DTCP_CONTENT_RANGE_HEADER, response);
+            request.msg.response_headers.append (DTCP_CONTENT_RANGE_HEADER,
+                                                 response);
         }
+
         if (this.encrypted_length != UNSPECIFIED) {
-            request.msg.response_headers.set_content_length (this.encrypted_length);
+            request.msg.response_headers.set_content_length
+                                        (this.encrypted_length);
         }
     }
 
     public override string to_string () {
         return ("DTCPCleartextResponse(bytes=%lld-%lld/%lld, enc_len=%lld)"
-                .printf (this.start_byte, this.end_byte, this.total_size, this.encrypted_length));
+                .printf (this.start_byte,
+                         this.end_byte,
+                         this.total_size,
+                         this.encrypted_length));
     }
 }
diff --git a/src/librygel-server/rygel-http-byte-seek-request.vala 
b/src/librygel-server/rygel-http-byte-seek-request.vala
index 4e57b50..4f7404d 100644
--- a/src/librygel-server/rygel-http-byte-seek-request.vala
+++ b/src/librygel-server/rygel-http-byte-seek-request.vala
@@ -59,19 +59,21 @@ public class Rygel.HTTPByteSeekRequest : Rygel.HTTPSeekRequest {
 
         int64 start_byte, end_byte, total_size;
 
-        // The size (entity body size) may not be known up-front (especially for live sources)
+        // The size (entity body size) may not be known up-front (especially
+        // for live sources)
         total_size = request.handler.get_resource_size ();
         if (total_size < 0) {
             total_size = UNSPECIFIED;
         }
 
-        // Note: DLNA restricts the syntax on the Range header (see DLNA 7.5.4.3.2.22.3)
-        //       And we need to retain the concept of an "open range" ("bytes=DIGITS-")
-        //       since the interpretation/legality varies based on the context
-        //       (e.g. DLNA 7.5.4.3.2.19.2, 7.5.4.3.2.20.1, 7.5.4.3.2.20.3)
+        // Note: DLNA restricts the syntax on the Range header (see
+        //       DLNA 7.5.4.3.2.22.3) And we need to retain the concept of an
+        //       "open range" ("bytes=DIGITS-") since the interpretation and
+        //       legality varies based on the context (e.g. DLNA 7.5.4.3.2.19.2,
+        //       7.5.4.3.2.20.1, 7.5.4.3.2.20.3)
         if (!range.has_prefix ("bytes=")) {
-            throw new HTTPSeekRequestError.INVALID_RANGE
-                          ("Invalid Range value (missing 'bytes=' field): '%s'", range);
+            var msg = ("Invalid Range value (missing 'bytes=' field): '%s'");
+            throw new HTTPSeekRequestError.INVALID_RANGE (msg, range);
         }
 
         var parsed_range = range.substring (6);
@@ -82,15 +84,18 @@ public class Rygel.HTTPByteSeekRequest : Rygel.HTTPSeekRequest {
 
         var range_tokens = parsed_range.split ("-", 2);
 
-        if (!int64.try_parse (strip_leading_zeros(range_tokens[0]), out start_byte)) {
+        if (!int64.try_parse (strip_leading_zeros (range_tokens[0]),
+                              out start_byte)) {
             throw new HTTPSeekRequestError.INVALID_RANGE
                           ("Invalid Range start value: '%s'", range);
         }
 
         if ((total_size != UNSPECIFIED) && (start_byte >= total_size)) {
-            throw new HTTPSeekRequestError.OUT_OF_RANGE
-                          ("Range start value %lld is larger than content size %lld: '%s'",
-                          start_byte, total_size, range);
+            var msg = /*_*/("Range start value %lld is larger than content size %lld: '%s'");
+            throw new HTTPSeekRequestError.OUT_OF_RANGE (msg,
+                                                         start_byte,
+                                                         total_size,
+                                                         range);
         }
 
         if (range_tokens[1] == null || (range_tokens[1].length == 0)) {
@@ -101,14 +106,17 @@ public class Rygel.HTTPByteSeekRequest : Rygel.HTTPSeekRequest {
                 range_length = UNSPECIFIED;
             }
         } else {
-            if (!int64.try_parse (strip_leading_zeros(range_tokens[1]), out end_byte)) {
+            if (!int64.try_parse (strip_leading_zeros(range_tokens[1]),
+                                  out end_byte)) {
                 throw new HTTPSeekRequestError.INVALID_RANGE
-                              ("Invalid Range end value: '%s'", range);
+                                       ("Invalid Range end value: '%s'", range);
             }
             if (end_byte < start_byte) {
-                throw new HTTPSeekRequestError.INVALID_RANGE
-                              ("Range end value %lld is smaller than range start value %lld: '%s'",
-                              end_byte, start_byte, range);
+                var msg = /*_*/("Range end value %lld is smaller than range start value %lld: '%s'");
+                throw new HTTPSeekRequestError.INVALID_RANGE (msg,
+                                                              end_byte,
+                                                              start_byte,
+                                                              range);
             }
             if ((total_size != UNSPECIFIED) && (end_byte >= total_size)) {
                 end_byte = total_size - 1;
@@ -135,8 +143,8 @@ public class Rygel.HTTPByteSeekRequest : Rygel.HTTPSeekRequest {
         return (request.msg.request_headers.get_one ("Range") != null);
     }
 
-    // Leading "0"s cause try_parse() to assume the value is octal (see Vala bug 656691)
-    //  So we strip them off before passing to int64.try_parse()
+    // Leading "0"s cause try_parse() to assume the value is octal (see Vala
+    // bug 656691) So we strip them off before passing to int64.try_parse()
     private static string strip_leading_zeros (string number_string) {
         int i=0;
         while ((number_string[i] == '0') && (i < number_string.length)) {
diff --git a/src/librygel-server/rygel-http-byte-seek-response.vala 
b/src/librygel-server/rygel-http-byte-seek-response.vala
index 459b2d9..7d05e80 100644
--- a/src/librygel-server/rygel-http-byte-seek-response.vala
+++ b/src/librygel-server/rygel-http-byte-seek-response.vala
@@ -48,10 +48,13 @@ public class Rygel.HTTPByteSeekResponse : Rygel.HTTPResponseElement {
      */
     public int64 total_size { get; set; }
 
-    public HTTPByteSeekResponse (int64 start_byte, int64 end_byte, int64 total_size) {
+    public HTTPByteSeekResponse (int64 start_byte,
+                                 int64 end_byte,
+                                 int64 total_size) {
         this.start_byte = start_byte;
         this.end_byte = end_byte;
-        this.range_length = end_byte-start_byte+1; // +1, since range is inclusive
+        // +1, since range is inclusive
+        this.range_length = end_byte - start_byte + 1;
         this.total_size = total_size;
     }
 
@@ -64,14 +67,18 @@ public class Rygel.HTTPByteSeekResponse : Rygel.HTTPResponseElement {
 
     public override void add_response_headers (Rygel.HTTPRequest request) {
         // Content-Range: bytes START_BYTE-END_BYTE/TOTAL_LENGTH (or "*")
-        request.msg.response_headers.set_content_range ( this.start_byte, this.end_byte,
-                                                         this.total_size );
+        request.msg.response_headers.set_content_range (this.start_byte,
+                                                        this.end_byte,
+                                                        this.total_size);
         request.msg.response_headers.append ("Accept-Ranges", "bytes");
         request.msg.response_headers.set_content_length (range_length);
     }
 
     public override string to_string () {
         return ("HTTPByteSeekResponse(bytes=%lld-%lld/%lld (%lld bytes))"
-                .printf (this.start_byte, this.end_byte, this.total_size, this.total_size));
+                .printf (this.start_byte,
+                         this.end_byte,
+                         this.total_size,
+                         this.total_size));
     }
 }
diff --git a/src/librygel-server/rygel-http-get-handler.vala b/src/librygel-server/rygel-http-get-handler.vala
index 9c68d4d..b9d766f 100644
--- a/src/librygel-server/rygel-http-get-handler.vala
+++ b/src/librygel-server/rygel-http-get-handler.vala
@@ -46,13 +46,12 @@ public abstract class Rygel.HTTPGetHandler: GLib.Object {
         var mode = request.msg.request_headers.get_one (TRANSFER_MODE_HEADER);
 
         // Per DLNA 7.5.4.3.2.33.2, if the transferMode header is empty it
-        // must be treated as Streaming mode or Interactive, depending upon the content
+        // must be treated as Streaming mode or Interactive, depending upon
+        // the content
         if (mode == null) {
-            request.msg.response_headers.append (TRANSFER_MODE_HEADER,
-                                                 this.get_default_transfer_mode ());
-        } else {
-            request.msg.response_headers.append (TRANSFER_MODE_HEADER, mode);
+            mode = this.get_default_transfer_mode ();
         }
+        request.msg.response_headers.append (TRANSFER_MODE_HEADER, mode);
 
         // Handle device-specific hacks that need to change the response
         // headers such as Samsung's subtitle stuff.
@@ -70,7 +69,8 @@ public abstract class Rygel.HTTPGetHandler: GLib.Object {
     }
 
     /**
-     * Returns true if the handler supports the given transfer mode, false otherwise.
+     * Returns true if the handler supports the given transfer mode, false
+     * otherwise.
      */
     public abstract bool supports_transfer_mode (string mode);
 
diff --git a/src/librygel-server/rygel-http-get.vala b/src/librygel-server/rygel-http-get.vala
index 3a49155..7d2b670 100644
--- a/src/librygel-server/rygel-http-get.vala
+++ b/src/librygel-server/rygel-http-get.vala
@@ -79,15 +79,18 @@ public class Rygel.HTTPGet : HTTPRequest {
         }
 
         { // Check the transfer mode
-            var transfer_mode = this.msg.request_headers.get_one (TRANSFER_MODE_HEADER);
+            var headers = this.msg.request_headers;
+            var transfer_mode = headers.get_one (TRANSFER_MODE_HEADER);
 
             if (transfer_mode == null) {
                 transfer_mode = this.handler.get_default_transfer_mode ();
             }
 
             if (! this.handler.supports_transfer_mode (transfer_mode)) {
-                throw new HTTPRequestError.UNACCEPTABLE ("%s transfer mode not supported for '%s'",
-                                                        transfer_mode, uri.to_string ());
+                var msg = /*_*/("%s transfer mode not supported for '%s'");
+                throw new HTTPRequestError.UNACCEPTABLE (msg,
+                                                         transfer_mode,
+                                                         uri.to_string ());
             }
         }
 
@@ -121,41 +124,50 @@ public class Rygel.HTTPGet : HTTPRequest {
         var supports_cleartext_seek = DTCPCleartextRequest.supported (this);
         var requested_cleartext_seek = DTCPCleartextRequest.requested (this);
 
-        // Order is significant here when the request has more than one seek header
+        var response_headers = this.msg.response_headers;
+
+        // Order is significant here when the request has more than one seek
+        // header
         if (requested_cleartext_seek) {
             if (!supports_cleartext_seek) {
-                throw new HTTPRequestError.UNACCEPTABLE ( "Cleartext seek not supported for "
-                                                          + this.uri.to_string () );
+                var msg = "Cleartext seek not supported for %s";
+                throw new HTTPRequestError.UNACCEPTABLE (msg,
+                                                         this.uri.to_string ());
             }
             if (requested_byte_seek) {
-                    // Per DLNA Link Protection 7.6.4.3.3.9
-                    throw new HTTPRequestError.UNACCEPTABLE ( "Both Cleartext and Range seek requested "
-                                                              + this.uri.to_string ());
+                var msg = "Both Cleartext and Range seek requested for %s";
+                // Per DLNA Link Protection 7.6.4.3.3.9
+                throw new HTTPRequestError.UNACCEPTABLE (msg,
+                                                         this.uri.to_string ());
             }
         } else if (requested_byte_seek) {
             if (!supports_byte_seek) {
-                throw new HTTPRequestError.UNACCEPTABLE ( "Byte seek not supported for "
-                                                          + this.uri.to_string () );
+                var msg = "Byte seek not supported for %s";
+                throw new HTTPRequestError.UNACCEPTABLE (msg,
+                                                         this.uri.to_string ());
             }
         } else if (requested_time_seek) {
             if (!supports_time_seek) {
-                throw new HTTPRequestError.UNACCEPTABLE ( "Time seek not supported for "
-                                                          + this.uri.to_string () );
+                var msg = "Time seek not supported for %s";
+                throw new HTTPRequestError.UNACCEPTABLE (msg,
+                                                         this.uri.to_string ());
             }
         }
 
-        // Check for DLNA PlaySpeed request only if Range or Range.dtcp.com is not
-        // in the request. DLNA 7.5.4.3.3.19.2, DLNA Link Protection : 7.6.4.4.2.12
-        // (is 7.5.4.3.3.19.2 compatible with the use case in 7.5.4.3.2.24.5?)
-        // Note: We need to check the speed first since direction factors into validating
-        //       the time-seek request
+        // Check for DLNA PlaySpeed request only if Range or Range.dtcp.com is
+        // not in the request. DLNA 7.5.4.3.3.19.2, DLNA Link Protection :
+        // 7.6.4.4.2.12 (is 7.5.4.3.3.19.2 compatible with the use case in
+        // 7.5.4.3.2.24.5?)
+        // Note: We need to check the speed first since direction factors into
+        //       validating the time-seek request
         try {
-            if ( !(requested_byte_seek || requested_cleartext_seek)
-                 && PlaySpeedRequest.requested (this) ) {
+            if (!(requested_byte_seek || requested_cleartext_seek)
+                && PlaySpeedRequest.requested (this)) {
                 this.speed_request = new PlaySpeedRequest.from_request (this);
                 debug ("Processing playspeed %s", speed_request.speed.to_string ());
                 if (this.speed_request.speed.is_normal_rate ()) {
-                    // This is not a scaled-rate request. Treat it as if it wasn't even there
+                    // This is not a scaled-rate request. Treat it as if it
+                    // wasn't even there
                     this.speed_request = null;
                 }
             } else {
@@ -172,7 +184,8 @@ public class Rygel.HTTPGet : HTTPRequest {
             } else {
                 throw error;
             }
-            debug ("Error processing PlaySpeed: %s", error.message);
+            warning ("Error processing PlaySpeed: %s", error.message);
+
             return;
         }
         try {
@@ -180,7 +193,7 @@ public class Rygel.HTTPGet : HTTPRequest {
             if (supports_cleartext_seek && requested_cleartext_seek) {
                 var cleartext_seek = new DTCPCleartextRequest (this);
                 debug ("Processing DTCP cleartext byte range request (bytes %lld to %lld)",
-                         cleartext_seek.start_byte, cleartext_seek.end_byte);
+                       cleartext_seek.start_byte, cleartext_seek.end_byte);
                 this.seek = cleartext_seek;
             } else if (supports_byte_seek && requested_byte_seek) {
                 var byte_seek = new HTTPByteSeekRequest (this);
@@ -189,17 +202,20 @@ public class Rygel.HTTPGet : HTTPRequest {
                 this.seek = byte_seek;
             } else if (supports_time_seek && requested_time_seek) {
                 // Assert: speed_request has been checked/processed
-                var time_seek = new HTTPTimeSeekRequest (this, ((this.speed_request == null) ? null
-                                                                : this.speed_request.speed) );
-                debug ("Processing " + time_seek.to_string ());
+                var speed = this.speed_request == null ? null
+                            : this.speed_request.speed;
+                var time_seek = new HTTPTimeSeekRequest (this, speed);
+                debug ("Processing time seek %s", time_seek.to_string ());
                 this.seek = time_seek;
             } else {
                 this.seek = null;
             }
         } catch (HTTPSeekRequestError error) {
-            warning ("Caught HTTPSeekRequestError: " + error.message);
+            warning ("Caught HTTPSeekRequestError: %s", error.message);
             this.server.unpause_message (this.msg);
-            this.end (error.code, error.message); // All seek error codes are Soup.Status codes
+            this.end (error.code, error.message);
+            // All seek error codes are Soup.Status codes
+
             return;
          }
 
@@ -219,26 +235,31 @@ public class Rygel.HTTPGet : HTTPRequest {
                 }
             }
         } catch (HTTPSeekRequestError error) {
-            warning ("Caught HTTPSeekRequestError on preroll: " + error.message);
+            warning ("Caught HTTPSeekRequestError on preroll: %s",
+                     error.message);
             this.server.unpause_message (this.msg);
-            this.end (error.code, error.message); // All seek error codes are Soup.Status codes
+            this.end (error.code, error.message);
+            // All seek error codes are Soup.Status codes
+
             return;
         }
 
         // Determine the size value
         int64 response_size;
         {
-            // Response size might have already been set by one of the response elements
-            response_size = this.msg.response_headers.get_content_length ();
+            // Response size might have already been set by one of the
+            // response elements
+            response_size = response_headers.get_content_length ();
 
             if (response_size > 0) {
-                this.msg.response_headers.set_content_length (response_size);
+                response_headers.set_content_length (response_size);
                 debug ("Response size set via response element: size "
                        + response_size.to_string());
             } else {
-                // If not already set by a response element, try to set it to the resource size
+                // If not already set by a response element, try to set it to
+                // the resource size
                 if ((response_size = this.handler.get_resource_size ()) > 0) {
-                    this.msg.response_headers.set_content_length (response_size);
+                    response_headers.set_content_length (response_size);
                     debug ("Response size set via response element: size "
                            + response_size.to_string());
                 } else {
@@ -272,18 +293,19 @@ public class Rygel.HTTPGet : HTTPRequest {
                     debug ("Response encoding set to CHUNKED");
                 }
             }
-            this.msg.response_headers.set_encoding (response_body_encoding);
+            response_headers.set_encoding (response_body_encoding);
         }
 
         // Determine the Vary header (if not HTTP 1.0)
         {
-            // Per DLNA 7.5.4.3.2.35.4, the Vary header needs to include the timeseek and/or
-            //  playspeed header if both/either are supported for the resource/uri
+            // Per DLNA 7.5.4.3.2.35.4, the Vary header needs to include the
+            // timeseek and/or playspeed header if both/either are supported
+            // for the resource/uri
             bool supports_playspeed = PlaySpeedRequest.supported (this);
             if (supports_time_seek || supports_playspeed) {
                 if (this.msg.get_http_version () != Soup HTTPVersion  1_0) {
                     var vary_header = new StringBuilder
-                                             (this.msg.response_headers.get_list ("Vary"));
+                                        (response_headers.get_list ("Vary"));
                     if (supports_time_seek) {
                         if (vary_header.len > 0) {
                             vary_header.append (",");
diff --git a/src/librygel-server/rygel-http-response-element.vala 
b/src/librygel-server/rygel-http-response-element.vala
index 0ac57cf..3346eba 100644
--- a/src/librygel-server/rygel-http-response-element.vala
+++ b/src/librygel-server/rygel-http-response-element.vala
@@ -13,18 +13,6 @@
  * You should have received a copy of the GNU Lesser General Public License
  * along with this program; if not, write to the Free Software Foundation,
  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
- * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
- * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL CABLE TELEVISION LABORATORIES
- * INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
- * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
- * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
- * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
 /**
diff --git a/src/librygel-server/rygel-http-server.vala b/src/librygel-server/rygel-http-server.vala
index 8f12b7a..87aaab2 100644
--- a/src/librygel-server/rygel-http-server.vala
+++ b/src/librygel-server/rygel-http-server.vala
@@ -78,13 +78,15 @@ public class Rygel.HTTPServer : GLib.Object, Rygel.StateMachine {
     /**
      * Set or unset options the server supports/doesn't support
      *
-     * Resources should be setup assuming server supports all optional delivery modes
+     * Resources should be setup assuming server supports all optional
+     * delivery modes
      */
     public void set_resource_delivery_options (MediaResource res) {
         res.protocol = this.get_protocol ();
         // Set this just to be safe
         res.dlna_flags |= DLNAFlags.DLNA_V15;
-        // This server supports all DLNA delivery modes - so leave those flags alone
+        // This server supports all DLNA delivery modes - so leave those flags
+        // alone
      }
 
     public bool need_proxy (string uri) {
diff --git a/src/librygel-server/rygel-http-subtitle-handler.vala 
b/src/librygel-server/rygel-http-subtitle-handler.vala
index ff18fe4..92a966c 100644
--- a/src/librygel-server/rygel-http-subtitle-handler.vala
+++ b/src/librygel-server/rygel-http-subtitle-handler.vala
@@ -34,7 +34,8 @@ internal class Rygel.HTTPSubtitleHandler : Rygel.HTTPGetHandler {
 
     public HTTPSubtitleHandler (MediaFileItem media_item,
                                 int subtitle_index,
-                                Cancellable? cancellable) throws HTTPRequestError {
+                                Cancellable? cancellable)
+                                throws HTTPRequestError {
         this.media_item = media_item;
         this.subtitle_index = subtitle_index;
         this.cancellable = cancellable;
@@ -48,8 +49,10 @@ internal class Rygel.HTTPSubtitleHandler : Rygel.HTTPGetHandler {
         }
 
         if (this.subtitle == null) {
-            throw new HTTPRequestError.NOT_FOUND ("Subtitle index %d not found for item '%s",
-                                                  subtitle_index, media_item.id);
+            var msg = /*_*/("Subtitle index %d not found for item '%s");
+            throw new HTTPRequestError.NOT_FOUND (msg,
+                                                  subtitle_index,
+                                                  media_item.id);
         }
     }
 
@@ -61,16 +64,18 @@ internal class Rygel.HTTPSubtitleHandler : Rygel.HTTPGetHandler {
     public override void add_response_headers (HTTPGet request)
                                                throws HTTPRequestError {
         // Add Content-Type
-        request.msg.response_headers.append ("Content-Type", subtitle.mime_type);
+        request.msg.response_headers.append ("Content-Type",
+                                             subtitle.mime_type);
 
         // Add contentFeatures.dlna.org
 
-        // This is functionally equivalent to how contentFeatures was formed via the
-        //  (deprecated) HTTPIdentityHandler
-        MediaResource res = this.media_item.get_resource_list ().get (0);
-        string protocol_info = res.get_protocol_info ().to_string ();
+        // This is functionally equivalent to how contentFeatures was formed
+        // via the (deprecated) HTTPIdentityHandler
+        var res = this.media_item.get_resource_list ().get (0);
+        var protocol_info = res.get_protocol_info ().to_string ();
         var pi_fields = protocol_info.split (":", 4);
-        request.msg.response_headers.append ("contentFeatures.dlna.org", pi_fields[3]);
+        request.msg.response_headers.append ("contentFeatures.dlna.org",
+                                             pi_fields[3]);
 
         // Chain-up
         base.add_response_headers (request);
diff --git a/src/librygel-server/rygel-http-thumbnail-handler.vala 
b/src/librygel-server/rygel-http-thumbnail-handler.vala
index 449cb0b..0074009 100644
--- a/src/librygel-server/rygel-http-thumbnail-handler.vala
+++ b/src/librygel-server/rygel-http-thumbnail-handler.vala
@@ -34,8 +34,8 @@ internal class Rygel.HTTPThumbnailHandler : Rygel.HTTPGetHandler {
 
     public HTTPThumbnailHandler (MediaFileItem media_item,
                                  int thumbnail_index,
-                                 Cancellable? cancellable) throws HTTPRequestError 
-    {
+                                 Cancellable? cancellable)
+                                 throws HTTPRequestError {
 
         this.media_item = media_item;
         this.thumbnail_index = thumbnail_index;
@@ -50,9 +50,12 @@ internal class Rygel.HTTPThumbnailHandler : Rygel.HTTPGetHandler {
                 this.thumbnail = visual_item.thumbnails.get (thumbnail_index);
             }
         }
+
         if (this.thumbnail == null) {
-            throw new HTTPRequestError.NOT_FOUND ("Thumbnail index %d not found for item '%s",
-                                                  thumbnail_index, media_item.id);
+            var msg = ("Thumbnail index %d not found for item '%s");
+            throw new HTTPRequestError.NOT_FOUND (msg,
+                                                  thumbnail_index,
+                                                  media_item.id);
         }
     }
 
@@ -64,14 +67,17 @@ internal class Rygel.HTTPThumbnailHandler : Rygel.HTTPGetHandler {
     public override void add_response_headers (HTTPGet request)
                                                throws HTTPRequestError {
         // Add Content-Type
-        request.msg.response_headers.append ("Content-Type", thumbnail.mime_type);
+        request.msg.response_headers.append ("Content-Type",
+                                             thumbnail.mime_type);
 
         // Add contentFeatures.dlna.org
-        MediaResource res = this.thumbnail.get_resource
-            (request.http_server.get_protocol (), this.thumbnail_index);
-        string protocol_info = res.get_protocol_info ().to_string ();
+        var res = this.thumbnail.get_resource
+                                        (request.http_server.get_protocol (),
+                                         this.thumbnail_index);
+        var protocol_info = res.get_protocol_info ().to_string ();
         var pi_fields = protocol_info.split (":", 4);
-        request.msg.response_headers.append ("contentFeatures.dlna.org", pi_fields[3]);
+        request.msg.response_headers.append ("contentFeatures.dlna.org",
+                                             pi_fields[3]);
 
         // Chain-up
         base.add_response_headers (request);
diff --git a/src/librygel-server/rygel-http-time-seek-request.vala 
b/src/librygel-server/rygel-http-time-seek-request.vala
index 008c77d..0633151 100644
--- a/src/librygel-server/rygel-http-time-seek-request.vala
+++ b/src/librygel-server/rygel-http-time-seek-request.vala
@@ -56,19 +56,20 @@ public class Rygel.HTTPTimeSeekRequest : Rygel.HTTPSeekRequest {
      * Create a HTTPTimeSeekRequest corresponding with a HTTPGet that contains a
      * TimeSeekRange.dlna.org header value.
      *
-     * Note: This constructor will check the syntax of the request (per DLNA 7.5.4.3.2.24.3)
-     *       as well as perform some range validation. If the provided request is associated
-     *       with a handler that can provide content duration, the start and end time will
-     *       be checked for out-of-bounds conditions. Additionally, the start and end will
-     *       be checked according to playspeed direction (with rate +1.0 assumed when speed
-     *       is not provided). When speed is provided, the range end parameter check is
-     *       relaxed when the rate is not +1.0 (per DLNA 7.5.4.3.2.24.4).
+     * Note: This constructor will check the syntax of the request (per DLNA
+     * 7.5.4.3.2.24.3) as well as perform some range validation. If the
+     * provided request is associated with a handler that can provide content
+     * duration, the start and end time will be checked for out-of-bounds
+     * conditions. Additionally, the start and end will be checked according
+     * to playspeed direction (with rate +1.0 assumed when speed is not
+     * provided). When speed is provided, the range end parameter check is
+     * relaxed when the rate is not +1.0 (per DLNA 7.5.4.3.2.24.4).
      *
      * @param request The HTTP GET/HEAD request
-     * @speed speed An associated speed request
+     * @param speed An associated speed request
      */
     internal HTTPTimeSeekRequest (HTTPGet request, PlaySpeed ? speed)
-            throws HTTPSeekRequestError {
+                                  throws HTTPSeekRequestError {
         base ();
 
         bool positive_rate = (speed == null) || speed.is_positive ();
@@ -113,9 +114,13 @@ public class Rygel.HTTPTimeSeekRequest : Rygel.HTTPSeekRequest {
             if (trick_mode && !positive_rate) { // Per DLNA 7.5.4.3.2.24.4
                 this.start_time = this.total_duration;
             } else { // See DLNA 7.5.4.3.2.24.8
+                var msg = /*_*/("Invalid %s start time %lldns is beyond the content duration of %lldns");
+
                 throw new HTTPSeekRequestError.OUT_OF_RANGE
-                              ("Invalid %s start time %lldns is beyond the content duration of %lldns",
-                               TIMESEEKRANGE_HEADER, start, this.total_duration);
+                                        (msg,
+                                         TIMESEEKRANGE_HEADER,
+                                         start,
+                                         this.total_duration);
             }
         } else { // Nothing to check it against - just store it
             this.start_time = start;
@@ -128,13 +133,17 @@ public class Rygel.HTTPTimeSeekRequest : Rygel.HTTPSeekRequest {
             // Check for valid range
             if (positive_rate) {
                 // Check for out-of-bounds range end or fence it in
-                if ((this.total_duration != UNSPECIFIED) && (end > this.total_duration)) {
+                if ((this.total_duration != UNSPECIFIED) &&
+                    (end > this.total_duration)) {
                     if (trick_mode) { // Per DLNA 7.5.4.3.2.24.4
                         this.end_time = this.total_duration;
                     } else { // Per DLNA 7.5.4.3.2.24.8
+                        var msg = /*_*/("Invalid %s start time %lldns is beyond the content duration of 
%lldns");
                         throw new HTTPSeekRequestError.OUT_OF_RANGE
-                                      ("Invalid %s end time %lldns is beyond the content duration of %lldns",
-                                       TIMESEEKRANGE_HEADER, end,this.total_duration);
+                                        (msg,
+                                         TIMESEEKRANGE_HEADER,
+                                         end,
+                                         this.total_duration);
                     }
                 } else {
                     this.end_time = end;
@@ -143,9 +152,11 @@ public class Rygel.HTTPTimeSeekRequest : Rygel.HTTPSeekRequest {
                 this.range_duration =  this.end_time - this.start_time;
                 // At positive rate, start < end
                 if (this.range_duration <= 0) { // See DLNA 7.5.4.3.2.24.12
+                    var msg = /*_*/("Invalid %s value (start time after end time - forward scan): '%s'");
                     throw new HTTPSeekRequestError.INVALID_RANGE
-                                  ("Invalid %s value (start time after end time - forward scan): '%s'",
-                                   TIMESEEKRANGE_HEADER, range);
+                                        (msg,
+                                         TIMESEEKRANGE_HEADER,
+                                         range);
                 }
             } else { // Negative rate
                 // Note: start_time has already been checked/clamped
@@ -153,9 +164,11 @@ public class Rygel.HTTPTimeSeekRequest : Rygel.HTTPSeekRequest {
                 this.range_duration = this.start_time - this.end_time;
                 // At negative rate, start > end
                 if (this.range_duration <= 0) { // See DLNA 7.5.4.3.2.24.12
+                    var msg = ("Invalid %s value (start time before end time - reverse scan): '%s'");
                     throw new HTTPSeekRequestError.INVALID_RANGE
-                                 ("Invalid %s value (start time before end time - reverse scan): '%s'",
-                                  TIMESEEKRANGE_HEADER, range);
+                                        (msg,
+                                         TIMESEEKRANGE_HEADER,
+                                         range);
                 }
             }
         } else { // End time not specified in the npt field ("start-")
@@ -167,24 +180,26 @@ public class Rygel.HTTPTimeSeekRequest : Rygel.HTTPSeekRequest {
                 if (positive_rate) {
                     this.range_duration = this.total_duration - this.start_time;
                 } else {
-                    this.range_duration = this.start_time; // Going backward from start to 0
+                    // Going backward from start to 0
+                    this.range_duration = this.start_time;
                 }
             }
         }
     }
 
     public string to_string () {
-        return ("HTTPTimeSeekRequest (npt=%lld-%s)".printf (this.start_time,
-                                                           (this.end_time != UNSPECIFIED
-                                                            ? this.end_time.to_string()
-                                                            : "*") ) );
+        return ("HTTPTimeSeekRequest (npt=%lld-%s)".printf
+                                        (this.start_time,
+                                         (this.end_time != UNSPECIFIED
+                                          ? this.end_time.to_string()
+                                          : "*")));
     }
 
     /**
      * Return true if time-seek is supported.
      *
-     * This method utilizes elements associated with the request to determine if a
-     * TimeSeekRange request is supported for the given request/resource.
+     * This method utilizes elements associated with the request to determine if
+     * a TimeSeekRange request is supported for the given request/resource.
      */
     public static bool supported (HTTPGet request) {
         bool force_seek = false;
@@ -192,7 +207,7 @@ public class Rygel.HTTPTimeSeekRequest : Rygel.HTTPSeekRequest {
         try {
             var hack = ClientHacks.create (request.msg);
             force_seek = hack.force_seek ();
-        } catch (Error error) { }
+        } catch (Error error) { /* Exception means no hack needed */ }
 
         return force_seek || request.handler.supports_time_seek ();
     }
@@ -201,10 +216,13 @@ public class Rygel.HTTPTimeSeekRequest : Rygel.HTTPSeekRequest {
      * Return true of the HTTPGet contains a TimeSeekRange request.
      */
     public static bool requested (HTTPGet request) {
-        return (request.msg.request_headers.get_one (TIMESEEKRANGE_HEADER) != null);
+        var header = request.msg.request_headers.get_one (TIMESEEKRANGE_HEADER);
+
+        return (header != null);
     }
 
-    // Parses npt times in the format of '417.33' and returns the time in microseconds
+    // Parses npt times in the format of '417.33' and returns the time in
+    // microseconds
     private static bool parse_npt_seconds (string range_token,
                                            ref int64 value) {
         if (range_token[0].isdigit ()) {
@@ -212,10 +230,12 @@ public class Rygel.HTTPTimeSeekRequest : Rygel.HTTPSeekRequest {
         } else {
             return false;
         }
+
         return true;
     }
 
-    // Parses npt times in the format of '10:19:25.7' and returns the time in microseconds
+    // Parses npt times in the format of '10:19:25.7' and returns the time in
+    // microseconds
     private static bool parse_npt_time (string? range_token,
                                         ref int64 value) {
         if (range_token == null) {
@@ -242,7 +262,8 @@ public class Rygel.HTTPTimeSeekRequest : Rygel.HTTPSeekRequest {
 
         foreach (string time in time_tokens) {
             if (time[0].isdigit ()) {
-                seconds_sum += (int64) ((double.parse (time) * TimeSpan.SECOND) * time_factor);
+                seconds_sum += (int64) ((double.parse (time) *
+                                         TimeSpan.SECOND) * time_factor);
             } else {
                 return false;
             }
diff --git a/src/librygel-server/rygel-http-time-seek-response.vala 
b/src/librygel-server/rygel-http-time-seek-response.vala
index 3e26e67..feca4c8 100644
--- a/src/librygel-server/rygel-http-time-seek-response.vala
+++ b/src/librygel-server/rygel-http-time-seek-response.vala
@@ -14,18 +14,6 @@
  * You should have received a copy of the GNU Lesser General Public License
  * along with this program; if not, write to the Free Software Foundation,
  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
- * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
- * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL CABLE TELEVISION LABORATORIES
- * INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
- * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
- * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
- * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
 public class Rygel.HTTPTimeSeekResponse : Rygel.HTTPResponseElement {
@@ -74,15 +62,19 @@ public class Rygel.HTTPTimeSeekResponse : Rygel.HTTPResponseElement {
      *
      * start_time and start_byte must be specified.
      *
-     * if total_duration and total_size are UNSPECIFIED, then the content duration/size
-     * will be signaled as unknown ("*")
+     * if total_duration and total_size are UNSPECIFIED, then the content
+     * duration/size will be signaled as unknown ("*")
      *
-     * if end_time is UNSPECIFIED, then the time range end will be omitted from the
-     * response. If the end_byte is UNSPECIFIED, the entire byte range response will be
-     * omitted. (see DLNA 7.5.4.3.2.24.3)
+     * if end_time is UNSPECIFIED, then the time range end will be omitted
+     * from the response. If the end_byte is UNSPECIFIED, the entire byte
+     * range response will be omitted. (see DLNA 7.5.4.3.2.24.3)
      */
-    public HTTPTimeSeekResponse (int64 start_time, int64 end_time, int64 total_duration,
-                                 int64 start_byte, int64 end_byte, int64 total_size) {
+    public HTTPTimeSeekResponse (int64 start_time,
+                                 int64 end_time,
+                                 int64 total_duration,
+                                 int64 start_byte,
+                                 int64 end_byte,
+                                 int64 total_size) {
         base ();
         this.start_time = start_time;
         this.end_time = end_time;
@@ -90,18 +82,25 @@ public class Rygel.HTTPTimeSeekResponse : Rygel.HTTPResponseElement {
 
         this.start_byte = start_byte;
         this.end_byte = end_byte;
-        this.response_length = (end_byte == UNSPECIFIED) ? UNSPECIFIED
-                                                         : (end_byte - start_byte + 1);
+        this.response_length = end_byte;
+
+        if (this.response_length != UNSPECIFIED) {
+            this.response_length -= (start_byte - 1);
+        }
+
         this.total_size = total_size;
     }
 
     /**
      * Create a HTTPTimeSeekResponse only containing a time range
      *
-     * Note: This form is only valid when byte-seek is not supported, according to the
-     * associated resource's ProtocolInfo (see DLNA 7.5.4.3.2.24.5)
+     * Note: This form is only valid when byte-seek is not supported,
+     * according to the associated resource's ProtocolInfo (see DLNA
+     * 7.5.4.3.2.24.5)
      */
-    public HTTPTimeSeekResponse.time_only (int64 start_time, int64 end_time, int64 total_duration) {
+    public HTTPTimeSeekResponse.time_only (int64 start_time,
+                                           int64 end_time,
+                                           int64 total_duration) {
         base ();
         this.start_time = start_time;
         this.end_time = end_time;
@@ -114,22 +113,25 @@ public class Rygel.HTTPTimeSeekResponse : Rygel.HTTPResponseElement {
     }
 
     /**
-     * Construct a HTTPTimeSeekResponse with time and byte range and allowing for a
-     * response length override. This is useful when the response body is larger than the
-     * specified byte range from the original content binary.
+     * Construct a HTTPTimeSeekResponse with time and byte range and allowing
+     * for a response length override. This is useful when the response body
+     * is larger than the specified byte range from the original content
+     * binary.
      *
      * start_time and start_byte must be specified.
      *
-     * If total_duration and total_size are UNSPECIFIED, then the content duration/size
-     * will be signaled as unknown ("*")
+     * If total_duration and total_size are UNSPECIFIED, then the content
+     * duration/size will be signaled as unknown ("*")
      *
-     * if end_time is UNSPECIFIED, then the time range end will be omitted from the
-     * response. If the end_byte is UNSPECIFIED, the entire byte range response will be
-     * omitted. (see DLNA 7.5.4.3.2.24.3)
+     * if end_time is UNSPECIFIED, then the time range end will be omitted
+     * from the response. If the end_byte is UNSPECIFIED, the entire byte
+     * range response will be omitted. (see DLNA 7.5.4.3.2.24.3)
      */
-    public HTTPTimeSeekResponse.with_length (int64 start_time, int64 end_time,
+    public HTTPTimeSeekResponse.with_length (int64 start_time,
+                                             int64 end_time,
                                              int64 total_duration,
-                                             int64 start_byte, int64 end_byte,
+                                             int64 start_byte,
+                                             int64 end_byte,
                                              int64 total_size,
                                              int64 response_length) {
         base ();
@@ -146,27 +148,31 @@ public class Rygel.HTTPTimeSeekResponse : Rygel.HTTPResponseElement {
     /**
      * Create a HTTPTimeSeekResponse from a HTTPTimeSeekRequest
      *
-     * Note: This form is only valid when byte-seek is not supported, according to the
-     * associated resource's ProtocolInfo (see DLNA 7.5.4.3.2.24.5)
+     * Note: This form is only valid when byte-seek is not supported,
+     * according to the associated resource's ProtocolInfo (see DLNA
+     * 7.5.4.3.2.24.5)
      */
-    public HTTPTimeSeekResponse.from_request ( HTTPTimeSeekRequest time_seek_request,
-                                              int64 total_duration ) {
-        HTTPTimeSeekResponse.time_only ( time_seek_request.start_time,
-                                         time_seek_request.end_time,
-                                         total_duration );
+    public HTTPTimeSeekResponse.from_request
+                                        (HTTPTimeSeekRequest time_seek_request,
+                                         int64               total_duration ) {
+        HTTPTimeSeekResponse.time_only (time_seek_request.start_time,
+                                        time_seek_request.end_time,
+                                        total_duration );
     }
 
     public override void add_response_headers (Rygel.HTTPRequest request) {
         var response = get_response_string ();
         if (response != null) {
-            request.msg.response_headers.append (HTTPTimeSeekRequest.TIMESEEKRANGE_HEADER,
-                                                 response);
+            var headers = request.msg.response_headers;
+            headers.append (HTTPTimeSeekRequest.TIMESEEKRANGE_HEADER, response);
             if (this.response_length != UNSPECIFIED) {
-                // Note: Don't use set_content_range () here - we don't want a "Content-range" header
-                request.msg.response_headers.set_content_length (this.response_length);
+                // Note: Don't use set_content_range () here - we don't want a
+                // "Content-range" header
+                headers.set_content_length (this.response_length);
             }
+
             if (request.msg.get_http_version () == Soup HTTPVersion  1_0) {
-                request.msg.response_headers.replace ("Pragma","no-cache");
+                headers.replace ("Pragma", "no-cache");
             }
         }
     }
@@ -178,31 +184,37 @@ public class Rygel.HTTPTimeSeekResponse : Rygel.HTTPResponseElement {
 
         // The response form of TimeSeekRange:
         //
-        // TimeSeekRange.dlna.org: npt=START_TIME-END_TIME/DURATION bytes=START_BYTE-END_BYTE/LENGTH
+        // TimeSeekRange.dlna.org: npt=START_TIME-END_TIME/DURATION
+        // bytes=START_BYTE-END_BYTE/LENGTH
         //
-        // The "bytes=" field can be ommitted in some cases. (e.g. ORG_OP a-val==1, b-val==0)
-        // The DURATION can be "*" in some cases (e.g. for limited-operation mode)
-        // The LENGTH can be "*" in some cases (e.g. for limited-operation mode)
-        // And the entire response header can be ommitted for HEAD requests (see DLNA 7.5.4.3.2.24.2)
+        // The "bytes=" field can be ommitted in some cases. (e.g. ORG_OP
+        // a-val==1, b-val==0) The DURATION can be "*" in some cases (e.g. for
+        // limited-operation mode) The LENGTH can be "*" in some cases (e.g.
+        // for limited-operation mode) And the entire response header can be
+        // ommitted for HEAD requests (see DLNA 7.5.4.3.2.24.2)
 
-        // It's not our job at this level to enforce all the semantics of the TimeSeekRange
-        //  response, as we don't have enough context. Setting up the correct HTTPTimeSeekRequest
-        //  object is the responsibility of the object owner. To form the response, we just
-        //  use what is set.
+        // It's not our job at this level to enforce all the semantics of the
+        // TimeSeekRange response, as we don't have enough context. Setting up
+        // the correct HTTPTimeSeekRequest object is the responsibility of the
+        // object owner. To form the response, we just use what is set.
 
         var response = new StringBuilder ();
         response.append ("npt=");
-        response.append_printf ("%.3f-", (double) this.start_time / TimeSpan.SECOND);
+        response.append_printf ("%.3f-",
+                                (double) this.start_time / TimeSpan.SECOND);
         if (this.end_time != UNSPECIFIED) {
-            response.append_printf ("%.3f", (double) this.end_time / TimeSpan.SECOND);
+            response.append_printf ("%.3f",
+                                    (double) this.end_time / TimeSpan.SECOND);
         }
         if (this.total_duration != UNSPECIFIED) {
-            response.append_printf ("/%.3f", (double) this.total_duration / TimeSpan.SECOND);
+            var total = (double) this.total_duration / TimeSpan.SECOND;
+            response.append_printf ("/%.3f", total);
         } else {
             response.append ("/*");
         }
 
-        if ((this.start_byte != UNSPECIFIED) && (this.end_byte != UNSPECIFIED)) {
+        if ((this.start_byte != UNSPECIFIED) &&
+            (this.end_byte != UNSPECIFIED)) {
             response.append (" bytes=");
             response.append (this.start_byte.to_string ());
             response.append ("-");
@@ -219,6 +231,7 @@ public class Rygel.HTTPTimeSeekResponse : Rygel.HTTPResponseElement {
    }
 
     public override string to_string () {
-        return ("HTTPTimeSeekResponse (%s)".printf (get_response_string ()));
+        return ("HTTPTimeSeekResponse (%s)".printf
+                                        (this.get_response_string ()));
     }
 }
diff --git a/src/librygel-server/rygel-image-item.vala b/src/librygel-server/rygel-image-item.vala
index 29dc17e..6c873b6 100644
--- a/src/librygel-server/rygel-image-item.vala
+++ b/src/librygel-server/rygel-image-item.vala
@@ -40,19 +40,22 @@ public class Rygel.ImageItem : MediaFileItem, VisualItem {
 
     /**
      * The width of the image in pixels.
-     * A value of -1 means that the width is unknown and will not, or did not, appear in DIDL-Lite XML.
+     * A value of -1 means that the width is unknown and will not, or did not,
+     * appear in DIDL-Lite XML.
      */
     public int width { get; set; default = -1; }
 
     /**
      * The height of the image in pixels.
-     * A value of -1 means that the height is unknown and will not, or did not, appear in DIDL-Lite XML.
+     * A value of -1 means that the height is unknown and will not, or did not,
+     * appear in DIDL-Lite XML.
      */
     public int height { get; set; default = -1; }
 
     /**
      *The number of bits per pixel used to represent the image resource.
-     * A value of -1 means that the color depth is unknown and will not, or did not, appear in DIDL-Lite XML.
+     * A value of -1 means that the color depth is unknown and will not, or did
+     * not, appear in DIDL-Lite XML.
      */
     public int color_depth { get; set; default = -1; }
 
diff --git a/src/librygel-server/rygel-import-resource.vala b/src/librygel-server/rygel-import-resource.vala
index d4532f9..174c758 100644
--- a/src/librygel-server/rygel-import-resource.vala
+++ b/src/librygel-server/rygel-import-resource.vala
@@ -137,11 +137,12 @@ internal class Rygel.ImportResource : GLib.Object, Rygel.StateMachine {
 
         try {
             var source_file = File.new_for_uri (this.item.get_primary_uri ());
-            this.output_stream = yield source_file.replace_async (null,
-                                                                  false,
-                                                                  FileCreateFlags.PRIVATE,
-                                                                  Priority.DEFAULT,
-                                                                  this.cancellable);
+            this.output_stream = yield source_file.replace_async
+                                        (null,
+                                         false,
+                                         FileCreateFlags.PRIVATE,
+                                         Priority.DEFAULT,
+                                         this.cancellable);
             var message = new Message ("GET", source_uri);
             message.got_chunk.connect (this.got_chunk_cb);
             message.got_body.connect (this.got_body_cb);
diff --git a/src/librygel-server/rygel-last-change-obj-add.vala 
b/src/librygel-server/rygel-last-change-obj-add.vala
index fe7886a..c27325c 100644
--- a/src/librygel-server/rygel-last-change-obj-add.vala
+++ b/src/librygel-server/rygel-last-change-obj-add.vala
@@ -37,8 +37,7 @@ internal class Rygel.LastChangeObjAdd : Rygel.LastChangeEntry {
         this.upnp_class = upnp_class;
     }
 
-    protected override string additional_info ()
-    {
+    protected override string additional_info () {
         var str = new StringBuilder ();
         var st_update = (this.sub_tree_update ? "1" : "0");
 
diff --git a/src/librygel-server/rygel-last-change-obj-del.vala 
b/src/librygel-server/rygel-last-change-obj-del.vala
index 5c50267..910ba10 100644
--- a/src/librygel-server/rygel-last-change-obj-del.vala
+++ b/src/librygel-server/rygel-last-change-obj-del.vala
@@ -31,8 +31,7 @@ internal class Rygel.LastChangeObjDel : Rygel.LastChangeEntry {
         this.sub_tree_update = sub_tree_update;
     }
 
-    protected override string additional_info ()
-    {
+    protected override string additional_info () {
         var str = new StringBuilder ();
         var st_update = (this.sub_tree_update ? "1" : "0");
 
diff --git a/src/librygel-server/rygel-last-change-obj-mod.vala 
b/src/librygel-server/rygel-last-change-obj-mod.vala
index b17a100..c046d2d 100644
--- a/src/librygel-server/rygel-last-change-obj-mod.vala
+++ b/src/librygel-server/rygel-last-change-obj-mod.vala
@@ -31,8 +31,7 @@ internal class Rygel.LastChangeObjMod : Rygel.LastChangeEntry {
         this.sub_tree_update = sub_tree_update;
     }
 
-    protected override string additional_info ()
-    {
+    protected override string additional_info () {
         var str = new StringBuilder ();
         var st_update = (this.sub_tree_update ? "1" : "0");
 
diff --git a/src/librygel-server/rygel-last-change-st-done.vala 
b/src/librygel-server/rygel-last-change-st-done.vala
index e685d10..509b5be 100644
--- a/src/librygel-server/rygel-last-change-st-done.vala
+++ b/src/librygel-server/rygel-last-change-st-done.vala
@@ -27,8 +27,7 @@ internal class Rygel.LastChangeStDone : Rygel.LastChangeEntry {
         base ("stDone", id, update_id);
     }
 
-    protected override string additional_info ()
-    {
+    protected override string additional_info () {
         return "";
     }
 }
diff --git a/src/librygel-server/rygel-media-container.vala b/src/librygel-server/rygel-media-container.vala
index d6e25f7..411cc8f 100644
--- a/src/librygel-server/rygel-media-container.vala
+++ b/src/librygel-server/rygel-media-container.vala
@@ -58,9 +58,10 @@ internal class Rygel.PlaylistDatasource : Rygel.DataSource, Object {
 
     public signal void data_ready ();
 
-    public Gee.List<HTTPResponseElement> ? preroll ( HTTPSeekRequest? seek_request,
-                                                     PlaySpeedRequest? playspeed_request)
-       throws Error {
+    public Gee.List<HTTPResponseElement>? preroll
+                                        (HTTPSeekRequest? seek_request,
+                                         PlaySpeedRequest? playspeed_request)
+                                         throws Error {
         if (seek_request != null) {
             throw new DataSourceError.SEEK_FAILED
                                         (_("Seeking not supported"));
@@ -303,8 +304,9 @@ public abstract class Rygel.MediaContainer : MediaObject {
         this.upnp_class = UPNP_CLASS;
         this.create_mode_enabled = false;
 
-        this.container_updated.connect (on_container_updated);
-        this.sub_tree_updates_finished.connect (on_sub_tree_updates_finished);
+        this.container_updated.connect (this.on_container_updated);
+        this.sub_tree_updates_finished.connect
+                                        (this.on_sub_tree_updates_finished);
         this.add_playlist_resources ();
     }
 
diff --git a/src/librygel-server/rygel-media-file-item.vala b/src/librygel-server/rygel-media-file-item.vala
index 763e502..6c75218 100644
--- a/src/librygel-server/rygel-media-file-item.vala
+++ b/src/librygel-server/rygel-media-file-item.vala
@@ -32,12 +32,12 @@ private errordomain Rygel.MediaFileItemError {
     BAD_URI
 }
 
-/**
- * Represents a file-accessible or http-accessible media item (music file, image file,
- * video file, etc) with some pre-established metadata or a content placeholder for
- * uploaded content.
+/** Represents a file-accessible or http-accessible media item (music file,
+ * image file, video file, etc) with some pre-established metadata or a
+ * content placeholder for uploaded content.
  *
- * Items representing non-file-accessible content should create their own MediaItem subclass.
+ * Items representing non-file-accessible content should create their own
+ * MediaItem subclass.
  */
 public abstract class Rygel.MediaFileItem : MediaItem {
     /**
@@ -137,10 +137,11 @@ public abstract class Rygel.MediaFileItem : MediaItem {
         var didl_item = base.serialize (serializer, http_server) as DIDLLiteItem;
 
         if (!this.place_holder) {
-            // Subclasses can override add_resources and augment the media resource list (which
-            //  should contain the primary resource representations for the MediaItem
-            //  at this point) with any secondary representations or alternate delivery
-            //  mechanisms they can provide
+            // Subclasses can override add_resources and augment the media
+            // resource list (which should contain the primary resource
+            // representations for the MediaItem at this point) with any
+            // secondary representations or alternate delivery mechanisms they
+            // can provide
             this.add_additional_resources (http_server);
         }
         this.serialize_resource_list (didl_item, http_server);
@@ -149,11 +150,15 @@ public abstract class Rygel.MediaFileItem : MediaItem {
     }
 
     /**
-     * Subclasses override this method to create the type-specific primary MediaResource.
+     * Subclasses override this method to create the type-specific primary
+     * MediaResource.
      *
-     * The resource returned is presumed to represent the "internal" file resource and
-     * a uri referring to the source file. Transport-specific variants can be created
-     * by the caller.
+     * The resource returned is presumed to represent the "internal" file
+     * resource and a uri referring to the source file. Transport-specific
+     * variants can be created by the caller.
+     *
+     * @return a RygelMediaResource for the on-disk file represented by this
+     * instance.
      */
     public virtual MediaResource get_primary_resource () {
         var res = new MediaResource ("primary");
@@ -167,19 +172,24 @@ public abstract class Rygel.MediaFileItem : MediaItem {
         try {
             res.protocol = this.get_protocol_for_uri (res.uri);
         } catch (Error e) {
-            warning ("Could not determine protocol for " + res.uri);
+            warning (_("Could not determine protocol for uri %s"),
+                     res.uri);
         }
-        res.extension = get_extension ();
+
+        res.extension = this.get_extension ();
         res.size = this.size;
+
         return res;
     }
 
     /**
-     * Return the file/uri extension that best represents the item's primary resource.
+     * Return the file/uri extension that best represents the item's primary
+     * resource.
      */
     public virtual string get_extension () {
         string uri_extension = null;
-        // Use the extension from the source content filename, if it has an extension
+        // Use the extension from the source content filename, if it has an
+        // extension
         string basename = Path.get_basename (this.get_primary_uri ());
         int dot_index = -1;
         if (basename != null) {
@@ -192,6 +202,7 @@ public abstract class Rygel.MediaFileItem : MediaItem {
         if (uri_extension == null) {
             uri_extension = ext_from_mime_type (this.mime_type);
         }
+
         return uri_extension;
     }
 
diff --git a/src/librygel-server/rygel-media-object.vala b/src/librygel-server/rygel-media-object.vala
index 8523370..e49e898 100644
--- a/src/librygel-server/rygel-media-object.vala
+++ b/src/librygel-server/rygel-media-object.vala
@@ -118,7 +118,8 @@ public abstract class Rygel.MediaObject : GLib.Object {
      *  - @@REALNAME@ will be substituted by the user's real name.
      *  - @@USERNAME@ will be substituted by the users's login ID.
      *  - @@HOSTNAME@ will be substituted by the name of the machine.
-     *  - @@ADDRESS@ will be substituted by the IP address of network interface used for the UpNP 
communication.
+     *  - @@ADDRESS@ will be substituted by the IP address of network interface
+     *    used for the UPnP communication.
      *  - @@PRETTY_HOSTNAME@ will be substituted by the human readable name of the machine
      *    (PRETTY_HOSTNAME field of /etc/machine-info)
      */
@@ -177,7 +178,7 @@ public abstract class Rygel.MediaObject : GLib.Object {
     public override void constructed () {
         base.constructed ();
 
-        uris = new ArrayList<string> ();
+        this.uris = new ArrayList<string> ();
     }
 
     /**
@@ -289,20 +290,28 @@ public abstract class Rygel.MediaObject : GLib.Object {
      * Replace each key in replacement_pairs with its corresponding
      * value in the source_string and return the result.
      *
+     * @param replacement_pairs HashTable of variable -> substitution pairs
+     * @param source_string String that shall have the replacements applied
+     * to.
+     *
      * If source_string is null, null is returned.
+     * @return null if source_string is null, string with all replacements
+     * applied otherwise.
      */
-    public static string ? apply_replacements
+    public static string? apply_replacements
                             (HashTable<string, string> replacement_pairs,
-                             string source_string) {
+                             string?                   source_string) {
         if (source_string == null) {
             return null;
         }
+
         var replaced_string = source_string;
         replacement_pairs.foreach ((search_string, replacement)
             => {
                     replaced_string
                         = replaced_string.replace (search_string, replacement);
                } );
+
         return replaced_string;
     }
 
@@ -369,7 +378,10 @@ public abstract class Rygel.MediaObject : GLib.Object {
                 }
             }
 
-        } catch (Error e) {}
+        } catch (Error e) {
+            debug ("Failed to apply fragments: %s. Ignoring.",
+                   e.message);
+        }
 
         return result;
     }
@@ -429,11 +441,11 @@ public abstract class Rygel.MediaObject : GLib.Object {
         }
 
         try {
-            var info = yield file.query_info_async (
-                    FileAttribute.ACCESS_CAN_WRITE,
-                    FileQueryInfoFlags.NONE,
-                    Priority.DEFAULT,
-                    cancellable);
+            var info = yield file.query_info_async
+                                        (FileAttribute.ACCESS_CAN_WRITE,
+                                         FileQueryInfoFlags.NONE,
+                                         Priority.DEFAULT,
+                                         cancellable);
 
             return info.get_attribute_boolean (FileAttribute.ACCESS_CAN_WRITE);
         } catch (IOError.NOT_FOUND error) {
diff --git a/src/librygel-server/rygel-media-query-action.vala 
b/src/librygel-server/rygel-media-query-action.vala
index b3f52aa..77ac0b3 100644
--- a/src/librygel-server/rygel-media-query-action.vala
+++ b/src/librygel-server/rygel-media-query-action.vala
@@ -170,7 +170,7 @@ internal abstract class Rygel.MediaQueryAction : GLib.Object, StateMachine {
 
             }
 
-            if (!supported_props.contains (property.slice(1, property.length))) {
+            if (!supported_props.contains (property.slice (1, property.length))) {
                 throw new ContentDirectoryError.INVALID_SORT_CRITERIA
                                         ("%s is invalid or not supported",
                                          property);
diff --git a/src/librygel-server/rygel-media-resource.vala b/src/librygel-server/rygel-media-resource.vala
index e9233d2..afe1194 100644
--- a/src/librygel-server/rygel-media-resource.vala
+++ b/src/librygel-server/rygel-media-resource.vala
@@ -13,18 +13,6 @@
  * You should have received a copy of the GNU Lesser General Public License
  * along with this program; if not, write to the Free Software Foundation,
  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
- * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
- * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL CABLE TELEVISION LABORATORIES
- * INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
- * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
- * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
- * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
 using GUPnP;
@@ -57,15 +45,18 @@ public class Rygel.MediaResource : GLib.Object {
     public string dlna_profile  { get; set; default = null; }
     public string network  { get; set; default = null; }
     public string[] play_speeds = null;
-    public DLNAConversion dlna_conversion { get; set; default = DLNAConversion.NONE; }
+    public DLNAConversion dlna_conversion { get; set;
+                                            default = DLNAConversion.NONE; }
     public DLNAFlags dlna_flags { get; set; default = DLNAFlags.NONE; }
-    public DLNAOperation dlna_operation { get; set; default = DLNAOperation.NONE; }
+    public DLNAOperation dlna_operation { get; set;
+                                          default = DLNAOperation.NONE; }
 
-    // I know gupnp-av DIDLLiteResource and ProtocolInfo structures have the above fields.
-    //  But both proved to be problematic in their current form when used in a variety
-    //  of containers (appears to be issues with reference management causing (incomplete)
-    //  copies of DIDLLiteResource/ProtocolInfo to be made). This class can be refactored
-    //  if/when these classes are made more flexible.
+    // I know gupnp-av DIDLLiteResource and ProtocolInfo structures have the
+    // above fields.  But both proved to be problematic in their current form
+    // when used in a variety of containers (appears to be issues with
+    // reference management causing (incomplete) copies of
+    // DIDLLiteResource/ProtocolInfo to be made). This class can be refactored
+    // if/when these classes are made more flexible.
 
     public MediaResource (string name) {
         this.name = name;
@@ -101,9 +92,11 @@ public class Rygel.MediaResource : GLib.Object {
         this.dlna_operation = that.dlna_operation;
     }
 
-    public MediaResource.from_didl_lite_resource (string name, DIDLLiteResource didl_resource) {
+    public MediaResource.from_didl_lite_resource (string name,
+                                                  DIDLLiteResource didl_resource) {
         // Create a MediaResource from the given DIDLLiteResource
-        // Note: For a DIDLLiteResource, a value of -1/null also signals "not set"
+        // Note: For a DIDLLiteResource, a value of -1/null also signals "not
+        // set"
         this.name = name;
         // res block
         this.uri = didl_resource.uri;
@@ -139,8 +132,8 @@ public class Rygel.MediaResource : GLib.Object {
     }
 
     public DIDLLiteResource serialize
-                               (DIDLLiteResource didl_resource,
-                                HashTable<string, string> ? replacements) {
+                                     (DIDLLiteResource didl_resource,
+                                      HashTable<string, string>? replacements) {
         // Note: For a DIDLLiteResource, a values -1/null also signal "not set"
         if (replacements == null) {
             didl_resource.uri = this.uri;
@@ -175,7 +168,7 @@ public class Rygel.MediaResource : GLib.Object {
     }
 
     public ProtocolInfo get_protocol_info
-                            (HashTable<string, string> ? replacements = null) {
+                            (HashTable<string, string>? replacements = null) {
         var new_pi = new ProtocolInfo ();
 
         new_pi.protocol = this.protocol;
@@ -199,31 +192,31 @@ public class Rygel.MediaResource : GLib.Object {
     }
 
     public bool supports_arbitrary_byte_seek () {
-        return is_dlna_operation_mode_set (DLNAOperation.RANGE);
+        return this.is_dlna_operation_mode_set (DLNAOperation.RANGE);
     }
 
     public bool supports_arbitrary_time_seek () {
-        return is_dlna_operation_mode_set (DLNAOperation.TIMESEEK);
+        return this.is_dlna_operation_mode_set (DLNAOperation.TIMESEEK);
     }
 
     public bool supports_limited_byte_seek () {
-        return is_dlna_protocol_flag_set (DLNAFlags.BYTE_BASED_SEEK);
+        return this.is_dlna_protocol_flag_set (DLNAFlags.BYTE_BASED_SEEK);
     }
 
     public bool supports_limited_time_seek () {
-        return is_dlna_protocol_flag_set (DLNAFlags.TIME_BASED_SEEK);
+        return this.is_dlna_protocol_flag_set (DLNAFlags.TIME_BASED_SEEK);
     }
 
     public bool supports_limited_cleartext_byte_seek () {
-        return is_dlna_protocol_flag_set (DLNAFlags.LOP_CLEARTEXT_BYTESEEK);
+        return this.is_dlna_protocol_flag_set (DLNAFlags.LOP_CLEARTEXT_BYTESEEK);
     }
 
     public bool supports_full_cleartext_byte_seek () {
-        return is_dlna_protocol_flag_set (DLNAFlags.CLEARTEXT_BYTESEEK_FULL);
+        return this.is_dlna_protocol_flag_set (DLNAFlags.CLEARTEXT_BYTESEEK_FULL);
     }
 
     public bool is_link_protection_enabled () {
-        return is_dlna_protocol_flag_set (DLNAFlags.LINK_PROTECTED_CONTENT);
+        return this.is_dlna_protocol_flag_set (DLNAFlags.LINK_PROTECTED_CONTENT);
     }
 
     public bool is_dlna_content () {
@@ -231,7 +224,7 @@ public class Rygel.MediaResource : GLib.Object {
     }
 
     public string get_default_transfer_mode () {
-        if (is_dlna_protocol_flag_set (DLNAFlags.STREAMING_TRANSFER_MODE)) {
+        if (this.is_dlna_protocol_flag_set (DLNAFlags.STREAMING_TRANSFER_MODE)) {
             return "Streaming";
         } else {
             return "Interactive";
@@ -245,24 +238,29 @@ public class Rygel.MediaResource : GLib.Object {
 
         switch (transfer_mode) {
             case "Streaming" :
-                return is_dlna_protocol_flag_set (DLNAFlags.STREAMING_TRANSFER_MODE);
+                return this.is_dlna_protocol_flag_set
+                                        (DLNAFlags.STREAMING_TRANSFER_MODE);
             case "Interactive" :
-                return is_dlna_protocol_flag_set (DLNAFlags.INTERACTIVE_TRANSFER_MODE);
+                return this.is_dlna_protocol_flag_set
+                                        (DLNAFlags.INTERACTIVE_TRANSFER_MODE);
             case "Background" :
-                return is_dlna_protocol_flag_set (DLNAFlags.BACKGROUND_TRANSFER_MODE);
+                return this.is_dlna_protocol_flag_set
+                                        (DLNAFlags.BACKGROUND_TRANSFER_MODE);
             default:
                 return false;
         }
     }
 
     public bool is_streamable () {
-        return is_dlna_protocol_flag_set (DLNAFlags.STREAMING_TRANSFER_MODE);
+        return this.is_dlna_protocol_flag_set
+                                        (DLNAFlags.STREAMING_TRANSFER_MODE);
     }
 
     // This is to check if any of the cleartext byte seek operations are supported.
     public bool is_cleartext_range_support_enabled () {
-        return ( is_dlna_protocol_flag_set (DLNAFlags.CLEARTEXT_BYTESEEK_FULL
-                                            | DLNAFlags.LOP_CLEARTEXT_BYTESEEK) );
+        return (this.is_dlna_protocol_flag_set
+                                        (DLNAFlags.CLEARTEXT_BYTESEEK_FULL |
+                                         DLNAFlags.LOP_CLEARTEXT_BYTESEEK));
     }
 
     public bool supports_playspeed () {
@@ -285,7 +283,8 @@ public class Rygel.MediaResource : GLib.Object {
                   .append_unichar (',');
         }
         if (this.cleartext_size >= 0) {
-            strbuf.append ("cleartextsize ").append (this.cleartext_size.to_string ())
+            strbuf.append ("cleartextsize ")
+                  .append (this.cleartext_size.to_string ())
                   .append_unichar (',');
         }
         if (this.duration >= 0) {
@@ -297,7 +296,8 @@ public class Rygel.MediaResource : GLib.Object {
                   .append_unichar (',');
         }
         if (this.bits_per_sample >= 0) {
-            strbuf.append ("bits_per_sample ").append (this.bits_per_sample.to_string ())
+            strbuf.append ("bits_per_sample ")
+                  .append (this.bits_per_sample.to_string ())
                   .append_unichar (',');
         }
         if (this.width >= 0) {
@@ -309,19 +309,23 @@ public class Rygel.MediaResource : GLib.Object {
                   .append_unichar (',');
         }
         if (this.color_depth >= 0) {
-            strbuf.append ("color_depth ").append (this.color_depth.to_string ())
+            strbuf.append ("color_depth ")
+                  .append (this.color_depth.to_string ())
                   .append_unichar (',');
         }
         if (this.audio_channels >= 0) {
-            strbuf.append ("audio_channels ").append (this.audio_channels.to_string ())
+            strbuf.append ("audio_channels ")
+                  .append (this.audio_channels.to_string ())
                   .append_unichar (',');
         }
         if (this.sample_freq >= 0) {
-            strbuf.append ("sample_freq ").append (this.sample_freq.to_string ())
+            strbuf.append ("sample_freq ")
+                  .append (this.sample_freq.to_string ())
                   .append_unichar (',');
         }
         if (this.network != null) {
-            strbuf.append ("network ").append (this.network).append_unichar (',');
+            strbuf.append ("network ")
+                  .append (this.network).append_unichar (',');
         }
         strbuf.append ("protocol ")
               .append (this.protocol == null ? "null" : this.protocol)
@@ -333,66 +337,73 @@ public class Rygel.MediaResource : GLib.Object {
               .append (this.dlna_profile == null ? "null" : this.dlna_profile)
               .append_unichar (',');
         strbuf.append_printf ("dlna_flags %.8X [", this.dlna_flags);
-        if (is_dlna_protocol_flag_set (DLNAFlags.SENDER_PACED)) {
+        if (this.is_dlna_protocol_flag_set (DLNAFlags.SENDER_PACED)) {
             strbuf.append ("sp-flag ");
         }
-        if (is_dlna_protocol_flag_set (DLNAFlags.TIME_BASED_SEEK)) {
+        if (this.is_dlna_protocol_flag_set (DLNAFlags.TIME_BASED_SEEK)) {
             strbuf.append ("lop-time ");
         }
-        if (is_dlna_protocol_flag_set (DLNAFlags.BYTE_BASED_SEEK)) {
+        if (this.is_dlna_protocol_flag_set (DLNAFlags.BYTE_BASED_SEEK)) {
             strbuf.append ("lop-byte ");
         }
-        if (is_dlna_protocol_flag_set (DLNAFlags.S0_INCREASE)) {
+        if (this.is_dlna_protocol_flag_set (DLNAFlags.S0_INCREASE)) {
             strbuf.append ("s0-increase ");
         }
-        if (is_dlna_protocol_flag_set (DLNAFlags.SN_INCREASE)) {
+        if (this.is_dlna_protocol_flag_set (DLNAFlags.SN_INCREASE)) {
             strbuf.append ("sn-increase ");
         }
-        if (is_dlna_protocol_flag_set (DLNAFlags.STREAMING_TRANSFER_MODE)) {
+        if (this.is_dlna_protocol_flag_set
+                                        (DLNAFlags.STREAMING_TRANSFER_MODE)) {
             strbuf.append ("streaming ");
         }
-        if (is_dlna_protocol_flag_set (DLNAFlags.INTERACTIVE_TRANSFER_MODE)) {
+        if (this.is_dlna_protocol_flag_set
+                                        (DLNAFlags.INTERACTIVE_TRANSFER_MODE)) {
             strbuf.append ("interactive ");
         }
-        if (is_dlna_protocol_flag_set (DLNAFlags.BACKGROUND_TRANSFER_MODE)) {
+        if (this.is_dlna_protocol_flag_set
+                                        (DLNAFlags.BACKGROUND_TRANSFER_MODE)) {
             strbuf.append ("background ");
         }
-        if (is_dlna_protocol_flag_set (DLNAFlags.CONNECTION_STALL)) {
+        if (this.is_dlna_protocol_flag_set (DLNAFlags.CONNECTION_STALL)) {
             strbuf.append ("stall ");
         }
-        if (is_dlna_protocol_flag_set (DLNAFlags.DLNA_V15)) {
+        if (this.is_dlna_protocol_flag_set (DLNAFlags.DLNA_V15)) {
             strbuf.append ("v1.5 ");
         }
-        if (is_dlna_protocol_flag_set (DLNAFlags.LINK_PROTECTED_CONTENT)) {
+        if (this.is_dlna_protocol_flag_set (DLNAFlags.LINK_PROTECTED_CONTENT)) {
             strbuf.append ("link-protected ");
         }
-        if (is_dlna_protocol_flag_set (DLNAFlags.CLEARTEXT_BYTESEEK_FULL)) {
+        if (this.is_dlna_protocol_flag_set
+                                        (DLNAFlags.CLEARTEXT_BYTESEEK_FULL)) {
             strbuf.append ("cleartext-full ");
         }
-        if (is_dlna_protocol_flag_set (DLNAFlags.LOP_CLEARTEXT_BYTESEEK)) {
+        if (this.is_dlna_protocol_flag_set (DLNAFlags.LOP_CLEARTEXT_BYTESEEK)) {
             strbuf.append ("cleartext-lop ");
         }
-        strbuf.overwrite (strbuf.len-1,"],"); // Replace space
+        strbuf.overwrite (strbuf.len - 1,"],"); // Replace space
 
         if (this.dlna_conversion != DLNAConversion.NONE) {
             strbuf.append_printf ("dlna_conversion %1d,", this.dlna_conversion);
         }
+
         if (this.dlna_operation != DLNAOperation.NONE) {
             strbuf.append_printf ("dlna_operation %.2X [", this.dlna_operation);
             if (is_dlna_operation_mode_set (DLNAOperation.RANGE)) {
                 strbuf.append ("byte-seek ");
             }
+
             if (is_dlna_operation_mode_set (DLNAOperation.TIMESEEK)) {
                 strbuf.append ("time-seek ");
             }
             strbuf.overwrite (strbuf.len-1,"],"); // Replace space
         }
+
         if (this.play_speeds != null) {
             strbuf.append ("play_speeds [");
             foreach (var speed in this.play_speeds) {
                 strbuf.append (speed).append_unichar (',');
             }
-            strbuf.overwrite (strbuf.len-1,"]"); // Replace comma
+            strbuf.overwrite (strbuf.len - 1,"]"); // Replace comma
         }
         strbuf.append (",uri ").append (this.uri == null ? "null" : this.uri);
         strbuf.append_unichar (')');
diff --git a/src/librygel-server/rygel-media-server-plugin.vala 
b/src/librygel-server/rygel-media-server-plugin.vala
index fd0aa13..998378d 100644
--- a/src/librygel-server/rygel-media-server-plugin.vala
+++ b/src/librygel-server/rygel-media-server-plugin.vala
@@ -181,8 +181,8 @@ public abstract class Rygel.MediaServerPlugin : Rygel.Plugin {
 
     // TODO: Document this, or make it unnecessary.
     public override void apply_hacks (RootDevice device,
-                                     string     description_path)
-                                     throws Error {
+                                      string     description_path)
+                                      throws Error {
         // Apply V1 downgrades
         string[] services = { ContentDirectory.UPNP_TYPE,
                               ConnectionManager.UPNP_TYPE };
diff --git a/src/librygel-server/rygel-music-item.vala b/src/librygel-server/rygel-music-item.vala
index d996e52..ab2451a 100644
--- a/src/librygel-server/rygel-music-item.vala
+++ b/src/librygel-server/rygel-music-item.vala
@@ -103,7 +103,8 @@ public class Rygel.MusicItem : AudioItem {
         if (!this.place_holder && this.album_art != null) {
             var protocol = this.get_protocol_for_uri (this.album_art.uri);
 
-            // Use the existing URI if the server is local or a non-internal/file uri is set
+            // Use the existing URI if the server is local or a non-internal
+            // file uri is set
             if (http_server.is_local () || protocol != "internal") {
                 didl_item.album_art = this.album_art.uri;
             } else {
diff --git a/src/librygel-server/rygel-object-removal-queue.vala 
b/src/librygel-server/rygel-object-removal-queue.vala
index b43da44..a4b71e0 100644
--- a/src/librygel-server/rygel-object-removal-queue.vala
+++ b/src/librygel-server/rygel-object-removal-queue.vala
@@ -83,7 +83,7 @@ internal class Rygel.ObjectRemovalQueue: GLib.Object {
 
             debug ("Auto-destroyed object '%s'!", object.id);
         } catch (Error err) {
-            warning ("Failed to auto-destroy temporary object '%s': %s",
+            warning (/*_*/("Failed to auto-destroy temporary object '%s': %s"),
                      object.id,
                      err.message);
         }
diff --git a/src/librygel-server/rygel-panasonic-hacks.vala b/src/librygel-server/rygel-panasonic-hacks.vala
index 6a08ddb..c5bc584 100644
--- a/src/librygel-server/rygel-panasonic-hacks.vala
+++ b/src/librygel-server/rygel-panasonic-hacks.vala
@@ -53,6 +53,10 @@ internal class Rygel.PanasonicHacks : ClientHacks {
             return;
         }
 
+        // Panasonic TVs only accept thumbnails with DLNA profile and mime
+        // type JPEG. This is correct from a DLNA pov, but we usually only
+        // supply PNG. When fooled into accepting it, they're rendered fine,
+        // however.
         foreach (var thumbnail in (item as VisualItem).thumbnails) {
             try {
                 thumbnail.mime_type = mime_regex.replace_literal
diff --git a/src/librygel-server/rygel-playspeed-request.vala 
b/src/librygel-server/rygel-playspeed-request.vala
index 4e8ee91..bbb3e0c 100644
--- a/src/librygel-server/rygel-playspeed-request.vala
+++ b/src/librygel-server/rygel-playspeed-request.vala
@@ -13,18 +13,6 @@
  * You should have received a copy of the GNU Lesser General Public License
  * along with this program; if not, write to the Free Software Foundation,
  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
- * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
- * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL CABLE TELEVISION LABORATORIES
- * INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
- * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
- * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
- * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
 public errordomain Rygel.PlaySpeedError {
@@ -37,13 +25,14 @@ public errordomain Rygel.PlaySpeedError {
  */
 public class Rygel.PlaySpeedRequest : GLib.Object {
     public static const string PLAYSPEED_HEADER = "PlaySpeed.dlna.org";
+
     public PlaySpeed speed { get; private set; }
 
     /**
      * Return true if playspeed is supported
      *
-     * This method utilizes elements associated with the request to determine if a
-     * PlaySpeed request is supported for the given request/resource.
+     * This method utilizes elements associated with the request to determine
+     * if a PlaySpeed request is supported for the given request/resource.
      */
     public static bool supported (HTTPGet request) {
         return request.handler.supports_playspeed ();
@@ -63,22 +52,25 @@ public class Rygel.PlaySpeedRequest : GLib.Object {
         this.speed = new PlaySpeed.from_string (speed);
     }
 
-    internal PlaySpeedRequest.from_request (Rygel.HTTPGet request) throws PlaySpeedError {
+    internal PlaySpeedRequest.from_request (Rygel.HTTPGet request)
+                                            throws PlaySpeedError {
         base ();
         // Format: PlaySpeed.dlna.org: speed=<rate>
-        string speed_string = request.msg.request_headers.get_one (PLAYSPEED_HEADER);
+        string speed_string = request.msg.request_headers.get_one
+                                        (PLAYSPEED_HEADER);
 
         if (speed_string == null) {
-            throw new PlaySpeedError.SPEED_NOT_PRESENT ("Could not find %s",
-                                                        PLAYSPEED_HEADER);
+            var msg = /*_*/("Could not find playspeed header %s");
+            throw new PlaySpeedError.SPEED_NOT_PRESENT (msg, PLAYSPEED_HEADER);
         }
 
         var elements = speed_string.split ("=");
 
         if ((elements.length != 2) || (elements[0] != "speed")) {
-            throw new PlaySpeedError.INVALID_SPEED_FORMAT ("ill-formed value for "
-                                                           + PLAYSPEED_HEADER + ": "
-                                                           + speed_string );
+            var msg = /*_*/("Ill-formed value for header %s: %s");
+            throw new PlaySpeedError.INVALID_SPEED_FORMAT (msg,
+                                                           PLAYSPEED_HEADER,
+                                                           speed_string);
         }
 
         speed = new PlaySpeed.from_string (elements[1]);
@@ -87,17 +79,19 @@ public class Rygel.PlaySpeedRequest : GLib.Object {
         if (!speed.is_normal_rate ()) {
             // Validate if playspeed is listed in the protocolInfo
             if (request.handler is HTTPMediaResourceHandler) {
-                MediaResource resource = (request.handler as HTTPMediaResourceHandler)
+                var resource = (request.handler as HTTPMediaResourceHandler)
                                          .media_resource;
                 var speeds = resource.play_speeds;
-                bool found_speed = false;
+                var found_speed = false;
                 foreach (var speed in speeds) {
                     var cur_speed = new PlaySpeedRequest.from_string (speed);
                     if (this.equals (cur_speed)) {
                         found_speed = true;
+
                         break;
                     }
                 }
+
                 if (!found_speed) {
                     throw new PlaySpeedError
                               .SPEED_NOT_PRESENT ("Unknown playspeed requested (%s)",
diff --git a/src/librygel-server/rygel-playspeed-response.vala 
b/src/librygel-server/rygel-playspeed-response.vala
index d2f92f9..9be6895 100644
--- a/src/librygel-server/rygel-playspeed-response.vala
+++ b/src/librygel-server/rygel-playspeed-response.vala
@@ -13,25 +13,13 @@
  * You should have received a copy of the GNU Lesser General Public License
  * along with this program; if not, write to the Free Software Foundation,
  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
- * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
- * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL CABLE TELEVISION LABORATORIES
- * INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
- * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
- * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
- * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
 /**
  * This class represents a DLNA PlaySpeed response (PlaySpeed.dlna.org)
  */
 public class Rygel.PlaySpeedResponse : Rygel.HTTPResponseElement {
-    public static const string FRAMERATE_HEADER = "FrameRateInTrickMode.dlna.org";
+    public const string FRAMERATE_HEADER = "FrameRateInTrickMode.dlna.org";
 
     PlaySpeed speed;
     public static const int NO_FRAMERATE = -1;
@@ -48,14 +36,14 @@ public class Rygel.PlaySpeedResponse : Rygel.HTTPResponseElement {
     }
 
     public PlaySpeedResponse.from_speed (PlaySpeed speed, int framerate)
-       throws PlaySpeedError {
+                                         throws PlaySpeedError {
         base ();
         this.speed = speed;
         this.framerate = framerate;
     }
 
     public PlaySpeedResponse.from_string (string speed, int framerate)
-       throws PlaySpeedError {
+                                          throws PlaySpeedError {
         base ();
         this.speed = new PlaySpeed.from_string (speed);
         this.framerate = framerate;
@@ -69,16 +57,20 @@ public class Rygel.PlaySpeedResponse : Rygel.HTTPResponseElement {
 
     public override void add_response_headers (Rygel.HTTPRequest request) {
         if (!this.speed.is_normal_rate ()) {
+            var headers = request.msg.response_headers;
+
             // Format: PlaySpeed.dlna.org: speed=<rate>
-            request.msg.response_headers.append (PlaySpeedRequest.PLAYSPEED_HEADER,
-                                                 "speed=" + this.speed.to_string ());
+            headers.append (PlaySpeedRequest.PLAYSPEED_HEADER,
+                            "speed=" + this.speed.to_string ());
+
             if (this.framerate > 0) {
                 // Format: FrameRateInTrickMode.dlna.org: rate=<2-digit framerate>
                 var framerate_val = "rate=%02d".printf(this.framerate);
-                request.msg.response_headers.append (FRAMERATE_HEADER, framerate_val);
+                headers.append (FRAMERATE_HEADER, framerate_val);
             }
+
             if (request.msg.get_http_version () == Soup HTTPVersion  1_0) {
-                request.msg.response_headers.replace ("Pragma","no-cache");
+                headers.replace ("Pragma", "no-cache");
             }
         }
     }
diff --git a/src/librygel-server/rygel-playspeed.vala b/src/librygel-server/rygel-playspeed.vala
index ad96c6e..2920d92 100644
--- a/src/librygel-server/rygel-playspeed.vala
+++ b/src/librygel-server/rygel-playspeed.vala
@@ -13,18 +13,6 @@
  * You should have received a copy of the GNU Lesser General Public License
  * along with this program; if not, write to the Free Software Foundation,
  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
- * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
- * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL CABLE TELEVISION LABORATORIES
- * INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
- * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
- * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
- * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
 /**
@@ -65,36 +53,42 @@ public class Rygel.PlaySpeed {
         if (this.denominator == 1) {
             return numerator.to_string ();
         } else {
-            return this.numerator.to_string () + "/" + this.denominator.to_string ();
+            return "%d/%u".printf (this.numerator, this.denominator);
         }
     }
 
     public float to_float () {
-        return (float)numerator/denominator;
+        return (float) numerator / denominator;
     }
 
     public double to_double () {
-        return (double)numerator/denominator;
+        return (double) numerator / denominator;
     }
 
     private void parse (string speed) throws PlaySpeedError {
-        if (! ("/" in speed)) {
+        if (!("/" in speed)) {
             this.numerator = int.parse (speed);
             this.denominator = 1;
         } else {
             var elements = speed.split ("/");
             if (elements.length != 2) {
-                throw new PlaySpeedError.INVALID_SPEED_FORMAT ("Missing/extra numerator/denominator");
+                var msg = /*_*/("Missing/extra numerator/denominator in fraction %s");
+                throw new PlaySpeedError.INVALID_SPEED_FORMAT (msg, speed);
             }
             this.numerator = int.parse (elements[0]);
             this.denominator = int.parse (elements[1]);
         }
-        // "0" isn't a valid numerator or denominator (and parse returns "0" on parse error)
+
+        // "0" isn't a valid numerator or denominator (and parse returns "0" on
+        // parse error)
         if (this.numerator == 0) {
-            throw new PlaySpeedError.INVALID_SPEED_FORMAT ("Invalid numerator in speed: " + speed);
+            var msg = /*_*/("Invalid numerator in speed %s");
+            throw new PlaySpeedError.INVALID_SPEED_FORMAT (msg.printf (speed));
         }
+
         if (this.denominator <= 0) {
-            throw new PlaySpeedError.INVALID_SPEED_FORMAT ("Invalid denominator in speed: " + speed);
+            var msg = /*_*/("Invalid numerator in speed %s");
+            throw new PlaySpeedError.INVALID_SPEED_FORMAT (msg.printf (speed));
         }
     }
 }
diff --git a/src/librygel-server/rygel-simple-container.vala b/src/librygel-server/rygel-simple-container.vala
index 167abaa..fa748ff 100644
--- a/src/librygel-server/rygel-simple-container.vala
+++ b/src/librygel-server/rygel-simple-container.vala
@@ -215,7 +215,10 @@ public class Rygel.SimpleContainer : Rygel.MediaContainer,
         } else {
             max_count = this.child_count;
         }
-        var children_to_search = yield this.get_children (0, max_count, "", cancellable);
+        var children_to_search = yield this.get_children (0,
+                                                          max_count,
+                                                          "",
+                                                          cancellable);
 
         do {
             restart = false;
diff --git a/src/librygel-server/rygel-subtitle-manager.vala b/src/librygel-server/rygel-subtitle-manager.vala
index f469dc4..5167c77 100644
--- a/src/librygel-server/rygel-subtitle-manager.vala
+++ b/src/librygel-server/rygel-subtitle-manager.vala
@@ -63,21 +63,28 @@ internal class Rygel.SubtitleManager : GLib.Object {
             var subtitle_file = directory.get_child (filename);
 
             try {
-                var info = subtitle_file.query_info (FileAttribute.ACCESS_CAN_READ + "," +
-                                                     FileAttribute.STANDARD_SIZE + "," +
-                                                     FileAttribute.STANDARD_CONTENT_TYPE,
+                var attribs = FileAttribute.ACCESS_CAN_READ + "," +
+                              FileAttribute.STANDARD_SIZE + "," +
+                              FileAttribute.STANDARD_CONTENT_TYPE;
+
+                var info = subtitle_file.query_info (attribs,
                                                      FileQueryInfoFlags.NONE,
                                                      null);
 
                 if (info.get_attribute_boolean (FileAttribute.ACCESS_CAN_READ)) {
-                    string content_type = info.get_attribute_string (FileAttribute.STANDARD_CONTENT_TYPE);
+                    var content_type = info.get_attribute_string
+                                        (FileAttribute.STANDARD_CONTENT_TYPE);
                     var subtitle = new Subtitle (content_type, ext);
                     subtitle.uri = subtitle_file.get_uri ();
                     subtitle.size = (int64) info.get_attribute_uint64
-                                                    (FileAttribute.STANDARD_SIZE);
-                    subtitles.add(subtitle);
+                                        (FileAttribute.STANDARD_SIZE);
+                    subtitles.add (subtitle);
                 }
-            } catch (Error err) { }
+            } catch (Error err) {
+                debug ("Failed to query file information for %s: %s",
+                       subtitle_file.get_path (),
+                       err.message);
+            }
         }
 
         if (subtitles.size == 0) {
diff --git a/src/librygel-server/rygel-thumbnail.vala b/src/librygel-server/rygel-thumbnail.vala
index 9b38f31..78aed20 100644
--- a/src/librygel-server/rygel-thumbnail.vala
+++ b/src/librygel-server/rygel-thumbnail.vala
@@ -47,7 +47,8 @@ public class Rygel.Thumbnail : Rygel.IconInfo {
         res.mime_type = this.mime_type;
         res.dlna_profile = this.dlna_profile;
         res.protocol = protocol;
-        // Note: These represent best-case. The MediaServer/HTTPServer can dial these back
+        // Note: These represent best-case. The MediaServer/HTTPServer can
+        // dial these back
         res.dlna_flags |= DLNAFlags.INTERACTIVE_TRANSFER_MODE |
                           DLNAFlags.BACKGROUND_TRANSFER_MODE |
                           DLNAFlags.CONNECTION_STALL |
diff --git a/src/librygel-server/rygel-trackable-container.vala 
b/src/librygel-server/rygel-trackable-container.vala
index 60b4799..96af497 100644
--- a/src/librygel-server/rygel-trackable-container.vala
+++ b/src/librygel-server/rygel-trackable-container.vala
@@ -46,7 +46,7 @@ public interface Rygel.TrackableContainer : Rygel.MediaContainer {
                 yield this.remove_child_tracked (child);
             }
         } catch (Error error) {
-            warning ("Failed to clear trackable container %s: %s",
+            warning (/*_*/("Failed to clear trackable container %s: %s"),
                      id,
                      error.message);
         }
diff --git a/src/librygel-server/rygel-video-item.vala b/src/librygel-server/rygel-video-item.vala
index d80da39..dd1ce25 100644
--- a/src/librygel-server/rygel-video-item.vala
+++ b/src/librygel-server/rygel-video-item.vala
@@ -152,7 +152,9 @@ public class Rygel.VideoItem : AudioItem, VisualItem {
                 try {
                     protocol = this.get_protocol_for_uri (subtitle.uri);
                 } catch (Error e) {
-                    message ("Could not determine protocol for " + subtitle.uri);
+                    message (/*_*/("Could not determine protocol for URI %s"),
+                             subtitle.uri);
+
                     continue;
                 }
 
@@ -181,8 +183,9 @@ public class Rygel.VideoItem : AudioItem, VisualItem {
                 }
             }
             if (main_subtitle != null) {
-                // Add resource-level subtitle metadata to all streamable video resources
-                // Note: All resources have already been serialized by the base
+                // Add resource-level subtitle metadata to all streamable
+                // video resources Note: All resources have already been
+                // serialized by the base
                 var resources = didl_item.get_resources ();
                 foreach (var resource in resources) {
                     if ( (resource.protocol_info.dlna_flags
diff --git a/src/librygel-server/rygel-visual-item.vala b/src/librygel-server/rygel-visual-item.vala
index d2fa2d2..ed12329 100644
--- a/src/librygel-server/rygel-visual-item.vala
+++ b/src/librygel-server/rygel-visual-item.vala
@@ -87,7 +87,9 @@ public interface Rygel.VisualItem : MediaFileItem {
                 try {
                     protocol = this.get_protocol_for_uri (thumbnail.uri);
                 } catch (Error e) {
-                    message ("Could not determine protocol for " + thumbnail.uri);
+                    message (/*_*/("Could not determine protocol for URI %s"),
+                             thumbnail.uri);
+
                     continue;
                 }
 
diff --git a/src/librygel-server/rygel-xbox-hacks.vala b/src/librygel-server/rygel-xbox-hacks.vala
index 13ae89b..02a989a 100644
--- a/src/librygel-server/rygel-xbox-hacks.vala
+++ b/src/librygel-server/rygel-xbox-hacks.vala
@@ -60,7 +60,7 @@ internal class Rygel.XBoxHacks : ClientHacks {
         particles += "th";
         particles += "0";
 
-        uri.set_path (string.joinv("/", particles));
+        uri.set_path (string.joinv ("/", particles));
     }
 
     public void apply_on_device (RootDevice device,


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