Love the tool, it's been an invaluable asset in uploading several GB
worth of photos to flickr. I've run into some problems though - some
photos don't seem to upload properly, and the only way I've gotten
around that so far is to remove them from my upload queue and
uploading them manually. This is obviously somewhat less desirable. :)
What happens on a problem picture is that I get the status bar message
that the picture is uploading, and from my network activity it seems
that the picture is getting uploaded. Once the upload "completes",
however, DFO silently fails and goes back to waiting on the next sync.
The picture never shows up in my photo stream.
To investigate this I checked out the latest source code and ran from
the console, and I ended up with the same problem. This time I had
console output however:
I ran into another bug. This one I could fix myself though. The
problem is as follows:
I added my blog to flickr via the web interface. My blog title
contains an apostrophe. When DFO downloads the blog information on
sync, this apostrophe causes a SQL error:
near "s": syntax error
at Mono.Data.SqliteClient.SqliteCommand.GetNextStatement (IntPtr
pzStart, System.IntPtr& pzTail, System.IntPtr& pStmt) [0x00000]
at Mono.Data.SqliteClient.SqliteCommand.ExecuteReader
(CommandBehavior behavior, Boolean want_results, System.Int32&
rows_affected) [0x00000]
at Mono.Data.SqliteClient.SqliteCommand.ExecuteNonQuery ()
[0x00000]
at PersistentInformation.RunNonQuery (System.String query)
[0x00000]
at PersistentInformation.InsertBlog (System.String blogid,
System.String blogtitle) [0x00000]
at FlickrCommunicator.UpdateBlogs () [0x00000]
at FlickrCommunicator.RoutineCheck () [0x00000]
I fixed this problem by sanitizing the blog title input before adding
it to the database. It's only a quick sanitation fix and by no means
complete:
In PersistentInformation.cs, line 1585:
public void InsertBlog(string blogid, string blogtitle) {
lock (_bloglock) {
RunNonQuery(String.Format(
"insert into blog (blogid, blogtitle) values ('{0}','{1}');",
blogid, blogtitle.Replace("'", "''")));
}
}
Hope that helps. :)
Cheers,
Toby
On Jun 10, 5:53 am, toluju <tobias.jun...@gmail.com> wrote:
> Love the tool, it's been an invaluable asset in uploading several GB
> worth of photos to flickr. I've run into some problems though - some
> photos don't seem to upload properly, and the only way I've gotten
> around that so far is to remove them from my upload queue and
> uploading them manually. This is obviously somewhat less desirable. :)
> What happens on a problem picture is that I get the status bar message
> that the picture is uploading, and from my network activity it seems
> that the picture is getting uploaded. Once the upload "completes",
> however, DFO silently fails and goes back to waiting on the next sync.
> The picture never shows up in my photo stream.
> To investigate this I checked out the latest source code and ran from
> the console, and I ended up with the same problem. This time I had
> console output however:
Good catch - I just started playing with dfo, and filed debian bug
486304 on what is basically the same thing in
PersistentInformation.InsertPool; presumably all of those RunQuery's
need to be sanitized (or replaced with something that does real SQL
argument passing instead of String.Format? Some googling suggests
constructing an SqliteParameter object for this case... (I'd pass on
more detail but this is the first time I've even *read* c-sharp code,
so I don't want to mangle anything in translation :-)