[rygel] core: Shorten title first, then mangle chars
- From: Jens Georg <jensgeorg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [rygel] core: Shorten title first, then mangle chars
- Date: Thu, 13 Oct 2011 12:44:43 +0000 (UTC)
commit 3eeafa681190e2329bd8284dd016a733c2cca1b2
Author: Jens Georg <mail jensge org>
Date: Thu Oct 13 10:56:06 2011 +0200
core: Shorten title first, then mangle chars
src/rygel/rygel-item-creator.vala | 15 ++++++++-------
1 files changed, 8 insertions(+), 7 deletions(-)
---
diff --git a/src/rygel/rygel-item-creator.vala b/src/rygel/rygel-item-creator.vala
index 5e98ee6..de25154 100644
--- a/src/rygel/rygel-item-creator.vala
+++ b/src/rygel/rygel-item-creator.vala
@@ -373,13 +373,14 @@ internal class Rygel.ItemCreator: GLib.Object, Rygel.StateMachine {
}
private string mangle_title (string title) throws Error {
- var mangled = this.title_regex.replace_literal (title,
- -1,
- 0,
- "_",
- RegexMatchFlags.NOTEMPTY);
-
- return mangled.substring (0, int.min (mangled.length, 240));
+ var mangled = title.substring (0, int.min (title.length, 240));
+ mangled = this.title_regex.replace_literal (mangled,
+ -1,
+ 0,
+ "_",
+ RegexMatchFlags.NOTEMPTY);
+
+ return mangled;
}
private async string create_uri (WritableContainer container, string title)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]