Yes, it would be great if Mediawiki gave us a unique alternative filename -
but we are out of time. Let's keep these thoughts for future enhancements.
Perhaps the timestamp down to minutes is sufficient to ensure uniqueness
for now, though one Commons admin pointed out that a timestamp is quite
unusual in a filename.
Phil
On Tue, Aug 21, 2012 at 1:03 PM, Platonides <platonides(a)gmail.com> wrote:
El 21/08/12 21:00, Maarten Dammers escribió:
To focus on the filename
Op 21-8-2012 19:58, Brion Vibber schreef:
The final filename should be whatever we provide
to MediaWiki's upload
API; I can't think how it would come from Cordova. It looks like it's
being added by MediaWiki, actually -- we're sending a filename without
an extension.
08-21 10:56:30.784: D/FileTransfer(9443): fileName: Second and Howard
Streets District (taken on 21Aug2012 10hrs56mins22secs)
Perhaps adding a '.jpg' extension would eliminate the auto-added one?
The
filename should be clear and unique. Some things you can hash into
the filename:
* Name
* Username
* Date
* Monument id
* Timestamp taken
You want to trim name if it exceeds a certain length. Inluding the id
and the username makes sure that you'll only collide with yourself.
Timestamp in iso format is probably a bit cleaner (YYYY-MM-DD HH:mm).
Maarten
ISO format does seem clear. Date gives much uniqueness, but pollutes the
filename. I'd prefer if when uploading the filename, we could suggest a
pattern and mediawiki gave us a unique alternative filename if needed.
For instance sending:
action=upload&filename=St._Andrew's_Church.jpg&filenamepattern=St.
%20Andrew's%20Church_-_%25d.jpg&comment=...
and receiving:
{"upload":{"result":"Warning","warnings":{"exists":"St._Andrew's_Church.jpg"},"available":
"St._Andrew's_Church-5.jpg, "filekey":...}
_______________________________________________
Wiki Loves Monuments mailing list
WikiLovesMonuments(a)lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikilovesmonuments
http://www.wikilovesmonuments.org
--
Phil Inje Chang
Product Manager, Mobile
Wikimedia Foundation
415-812-0854 m
415-882-7982 x 6810