Menulet for uploading Mac OS X Photos to Flickr.
Provided as-is, with no warranty that it'll be working as expected.
Warning, it might even delete elements from your Flickr account!
- objectiveflickr to communicate with the Flickr API
- ReactiveCocoa to make the code reactive
- Underscore.m for functional programming i.e. applying map/reduce operations to arrays
operationsToPerformSignal = mediaObjectsLoadedSignal.map(determineOperationForMediaObject)
flickrUploaderReadySignal = everySecondSignal.zip(previousOperationDoneSignal);
operationsToPerformSignal.zip(flickrUploaderReadySignal).subscribeNext(operation, ready) {
operation.execute();
}
+----------------+
| P2FOperation |
|----------------|
| execute() |
| getSizeBytes() |
| isDone() |
+----------------+
^
|
/—————————––––––––––––––––––––––+––––––––––––––––––––––––––––-\
| | |
+--------------------------+ +--------------------------+ +--------------------------+
| P2FUploadMediumOperation | | P2FUpdateMediumOperation | | P2FUpdateFolderOperation |
|--------------------------| |--------------------------| |--------------------------|
| | | | | |
|––––––––––––––––––––––––––| |--------------------------| |--------------------------|
| | | | | |
+--------------------------+ +--------------------------+ +--------------------------+
Progress computation:
- Goal: Progress indication with time remaining (e.g. 1:20 hour remaining)
- Assumption: Stable network connection
- Percent indication over total size in MB
- Use pic size in MB
- Assume 0.05 MB for all other requests
- Display "Estimating time remaining" until first MB uploaded
- Time remaining computed using average throughput during time elapsed
Operations performed:
-
Fetch picture list from Flickr, including metadata
- Max. 500 pics / request (Flickr API limit)
- Progress can be computed only after this operation
- Status indication: "Getting picture list from Flickr..."
-
For pics deleted since last upload: Delete picture from Flickr
-
For new pics & pics changed since last upload: Upload pictures and set metadata
- Upload order: oldest first
- Use size in MB for determining progress
- Progress indication: "Uploading Photos to Flickr..." + overall time remaining
- Debug info: Uploading : MB of MB uploaded + ( % completed)
-
For existing pics: Update pic metadata if changed
- Progress indication: "Uploading Photos to Flickr..." + overall time remaining
- Debug info: Updating ( of ) + ( % completed)
-
Create albums & assign pics to albums
- Progress indication: "Uploading Photos to Flickr..." + overall time remaining
- Debug info: Updating album ( of ) + ( % completed)
-
Sort albums: Out of scope
-
Done!
- Progress indication: "Last upload to Flickr on dd.mm.yyyy hh:mm"
Status bar:
- One-line progress indication
- Button to upload now / Button to abort
High priority:
- Feature: Upload Shared albums
Medium priority:
- Feature: Retry failed operations (and mark completed operations as done)
- Feature: Automatically upload to Flickr whenever media library is updated
- Feature: Persist and display last upload completion timestamp (x minutes ago)
- Feature: Use OFFlickrAPIRequest cancel to interrupt request in progress
- Feature: Update tags on Flickr when they're updated in Photos
Low priority:
- Refactor: Make FlickrClient reactive/asynchronous (not only its upload method)
- Feature: Sort albums