Index: /trunk/lib/Bookmarks.pm
===================================================================
--- /trunk/lib/Bookmarks.pm	(revision 75)
+++ /trunk/lib/Bookmarks.pm	(revision 76)
@@ -247,4 +247,5 @@
     my $mtime = time;
 
+    # update the URI, if it has changed
     my $changed_uri = 0;
     my $sth_current = $self->dbh->prepare('select uri from bookmarks where id = ?');
@@ -259,13 +260,21 @@
     }
 
-    # update the title
-    # TODO: only do this if the title has changed
-    # TODO: should we update mtime if the title changes?
-    my $sth_update = $self->dbh->prepare('update resources set title = ? where uri = ?');
-    $sth_update->execute($bookmark->title, $bookmark->uri);
-
+    # update the title, if it has changed
+    my $changed_title = 0;
+    my $sth_current_title = $self->dbh->prepare('select title from resources where uri = ?');
+    $sth_current_title->execute($bookmark->uri);
+    my ($stored_title) = $sth_current_title->fetchrow_array;
+
+    if ($stored_title ne $bookmark->title) {
+        my $sth_update = $self->dbh->prepare('update resources set title = ? where uri = ?');
+        $sth_update->execute($bookmark->title, $bookmark->uri);
+        $changed_title++;
+    }
+
+    # update the tags, if they have changed
     my $changed_tags = $self->_update_tags($bookmark->uri, $bookmark->tags);
 
-    if ($changed_uri or $changed_tags) {
+    # update the mtime, if the bookmark has actually been changed
+    if ($changed_uri or $changed_title or $changed_tags) {
         # update the mtime if the bookmark already existed but the tags were changed
         my $sth_update = $self->dbh->prepare('update bookmarks set mtime = ? where uri = ?');
