[tracker/harmattan-pre-signal-updates: 1258/1380] Flickr miner: fix critical on photos with no tags
- From: Martyn James Russell <mr src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [tracker/harmattan-pre-signal-updates: 1258/1380] Flickr miner: fix critical on photos with no tags
- Date: Wed, 22 Sep 2010 15:40:02 +0000 (UTC)
commit 87e333539e146eb99056df0beef4928acef5832a
Author: Adrien Bustany <abustany gnome org>
Date: Wed Sep 8 09:34:01 2010 +0200
Flickr miner: fix critical on photos with no tags
src/miners/flickr/tracker-miner-flickr.vala | 29 ++++++++++++++-------------
1 files changed, 15 insertions(+), 14 deletions(-)
---
diff --git a/src/miners/flickr/tracker-miner-flickr.vala b/src/miners/flickr/tracker-miner-flickr.vala
index 178680c..fe02990 100644
--- a/src/miners/flickr/tracker-miner-flickr.vala
+++ b/src/miners/flickr/tracker-miner-flickr.vala
@@ -287,7 +287,6 @@ public class MinerFlickr : Tracker.MinerWeb {
insert_photo_info (photo_node, builder, photo_url, photo_urn);
insert_exif_data (photo_node, builder, photo_url, photo_urn);
-
get_connection ().update (builder.result);
} catch (Error err) {
warning ("Couldn't insert photo %s: %s", photo_url, err.message);
@@ -328,23 +327,25 @@ public class MinerFlickr : Tracker.MinerWeb {
tag_node = root_node.find ("tags").find ("tag");
- builder.insert_open (graph);
- builder.subject_iri (urn);
+ if (tag_node != null) {
+ builder.insert_open (graph);
+ builder.subject_iri (urn);
- while (tag_node != null) {
- builder.predicate ("nao:hasTag");
+ while (tag_node != null) {
+ builder.predicate ("nao:hasTag");
- builder.object_blank_open ();
- builder.predicate ("a");
- builder.object ("nao:Tag");
- builder.predicate ("nao:prefLabel");
- builder.object_string (tag_node.get_attr ("raw"));
- builder.object_blank_close ();
+ builder.object_blank_open ();
+ builder.predicate ("a");
+ builder.object ("nao:Tag");
+ builder.predicate ("nao:prefLabel");
+ builder.object_string (tag_node.get_attr ("raw"));
+ builder.object_blank_close ();
- tag_node = tag_node.next;
- }
+ tag_node = tag_node.next;
+ }
- builder.insert_close ();
+ builder.insert_close ();
+ }
}
private void insert_exif_data (Rest.XmlNode photo_node, Tracker.Sparql.Builder builder, string graph, string urn) {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]