Comment 4 for bug 670185

Revision history for this message
Stuart Langridge (sil) wrote :

(ignore comment #3, I hit enter too early)

After useful discussion, the proposal is now as follows:

There are two types of records: set and trophy. Award records are not required.

A set record looks like this:
{
  "record_type": "http://cheersproject.example.org/records/trophyset",
  "id": "my-great-trophy-set", // this is a couchdb ID, so no spaces or weird characters; it is not user-displayed
  "stockicon": "gtk-info", // the stockid of an stock icon for this trophy; optional
  "name": {
    "default": "My Trophy Set",
    "en-us": "My Trophy Set",
    "fr-fr": "Mon Set de Trophie"
  }
}
and has an attachment "icon", which is a PNG of the set's icon.

A trophy record looks like this:
{
  "record_type": "http://cheersproject.example.org/records/trophy",
  "id": "some-id-for-trophy", // this is a couchdb ID, so no spaces or weird characters; it is not user-displayed
  "trophyset": "my-great-trophy-set",
  "stockicon": "gtk-info", // the stockid of an stock icon for this trophy; optional
  "application": "application://banshee.desktop",
  "title": {
    "default": "My Great Trophy",
    "fr-fr": "Mon Trophie a la Magnifique"
  },
  "description": {
    "default": "You must be really great! That's why you've got this trophy.",
    "fr-fr": "Vous ĂȘtes tres magnifique!"
  },
  "private_application_annotations": {
    "cheers": {
      "awarded": true,
      "awarded_timestamp": "2010-11-03T16:27:10+00:00"
    }
  }
}
and an attachment "icon", which is a PNG of the set's icon.

If a trophy doesn't have an "icon" attachment, use its "stockicon" key to get a Gtk stock icon for the trophy. If a trophy has neither, get its trophyset and use the trophyset's icon attachment. If the trophyset doesn't have an icon attachment, use the trophyset's stockicon. If the trophyset has neither, then use the default trophy icon, which is built into cheers.

Trophies that have not yet been awarded to this user either have private_application_annotations.cheers.awarded = False, or that key is not present at all. (When a trophy is first created, don't bother creating the private_application_annotations; if a trophy is awarded then unawarded, set private_application_annotations.cheers.awarded = False.) When a trophy is awarded to this user, set private_application_annotations.cheers.awarded = True, and set private_application_annotations.cheers.awarded_timestamp to the current ISO timestamp.