richq / folders2flickr

Upload files to flickr
Other
102 stars 38 forks source link

Feature request: sync service #27

Closed thomascobb closed 10 years ago

thomascobb commented 10 years ago

I'm a new flickr user who is used to dropbox, and I'm missing being able to have a local copy of all my photos that remains in sync with the remote service. I'm thinking about extending folders2flickr to do this, but I'm not sure how it fits with the existing module.

I'm thinking about using inotify (or something similar to make it cross platform) to work out when something has changed locally, then polling flickr.photos.recentlyUpdated with a single result to work out when something has changed remotely. I hope that all I need is a "last synced timestamp" file rather than an entire history file to work out what needs to be uploaded/downloaded.

However, I'm not sure about the local folder structure. I store my files by dated folders and all have unique file names, so I could map any photo on flickr to a full path on the local filesystem. I'm also not quite sure what to do with the collection (is that album?) name. I understand photos can appear in multiple collections so it probably can't appear in the folder structure, maybe a tag? I would also like to tag files in flickr and get these tags into the EXIF data on the local file. This probably needs a bit of care.

I'm a reasonably proficient python programmer, but I'm new to flickr and github so any pointers are much appreciated!

richq commented 10 years ago

This is a really cool idea, I'm just not sure how it'd really work in with tons of photos. From my experience with flickr, it's pretty slow - just seeing what is uploaded takes ages (i.e. just grabbing the metadata of what is on the flickr servers). There's another issue somewhere here issue #18 I think it was that had a good suggestion about syncing and I investigated the API a little to see how best to do it.

The structure right now is: you have say ~/photos and the files the script uploads are stored in a big dictionary (the history file) with their flickr ID. So ~/photos/2014-05-26/IMG_001.JPG might have the flickr ID 2345678 - the dictionary store has "2014-05-26/IMG_001.JPG" : 2345678 and 2345678 : "2014-05-26/IMG_001.JPG" as key/value maps.

richq commented 10 years ago

It was issue #7 that I was thinking of, though #18 has some more details on the history file.

thomascobb commented 10 years ago

I had a look, but it seems the code in the flickrsmartsync project is a better starting point as it is based on flickrapi rather than Flickr.py and follows a less aggressive tagging strategy! I'll keep you posted on how I get on!