Comment 1 for bug 670185

Revision history for this message
Seif Lotfy (seif) wrote : Re: [Bug 670185] [NEW] Suggested changes to the trophy data format

On Wed, Nov 3, 2010 at 1:30 AM, Stuart Langridge <
<email address hidden>> wrote:

> Public bug reported:
>
> At the moment, the trophy data looks like this:
> {
> "id":"sil-testing-trophy",
> "setname":"Testing",
> "seticon": "",
> "app":"application://banshee.desktop",
> "appname":"Banshee Music Player",
> "title":"Stuart's Testing Trophy",
> "iconpath":"",
> "priority": 1,
> "unlocked": "False",
> "stockicon":"",
> "desc": {
> "1": {
> "lang":"en-us",
> "desc": "Listen to Music alot"
> },
> "2": {
> "lang":"en-uk",
> "desc": "Listen to Music a lot, a lot"
> }
> }
> }
>
> This is pretty cool. Having looked at it a bit, I have a couple of
> suggestions for the format:
>
> {
> "id":"sil-testing-trophy",
> "setname":"Testing",
> "seticon": "",
> "app":"application://banshee.desktop",
> // remove appname
> "title":"Stuart's Testing Trophy",
> // make iconpath be an attachment
> // remove priority
> // remove unlocked
> "stockicon":"",
> "desc": {
> "default": { // add default key
> "desc": "Listen to Music alot"
> },
> "en-us": { // make lang the key
> "desc": "Listen to Music alot"
> },
> "en-uk": {
> "desc": "Listen to Music a lot, a lot"
> }
> }
> }
>
> Some notes on what the suggested changes actually mean:
>
> // remove appname
> It's probably best to look up the appname from the .desktop file when you
> need it, because then you'll get translated names, and because if the app
> changes its name you won't know
> // make iconpath be an attachment
> If you're storing data in desktopcouch, then a good way to store the icon
> for the trophy (if it's not a stock icon) is as an attachment to the
> desktopcouch record; that way, the icon follows the rest of the data around
> between machines and to websites and so on
> // remove priority
> I, personally, would suggest that all trophies are of the same priority as
> far as notify-osd is concerned. Things like a trophy award aren't really of
> critical priority; critical priority is for things like "your laptop will
> shut down in 30 seconds" :-)
> // remove unlocked
> Ideally you wouldn't need "unlocked" because that question is really "is
> there an award record for this person for this trophy", which is really
> quick to ask
> // make lang the key
> There may be a reason I haven't seen, but it might be best to use the
> language as the key to the desc dictionary; that way, finding a description
> for a language is quick (if you have numbers as the keys then to find the
> desc for "en-uk" you have to iterate through the whole dictionary until you
> find it)
> // add default key
> Of course, you'll want a default desc for where there isn't a translation
> for your language
>
> Just suggestions, but I quite like cheers so I thought I'd give you my
> thoughts.
>
> ** Affects: cheers
> Importance: Undecided
> Status: New
>
> --
> Suggested changes to the trophy data format
> https://bugs.launchpad.net/bugs/670185
> You received this bug notification because you are a member of Cheers,
> which is the registrant for Cheers.
>
> Status in Cheers: New
>
> Bug description:
> At the moment, the trophy data looks like this:
> {
> "id":"sil-testing-trophy",
> "setname":"Testing",
> "seticon": "",
> "app":"application://banshee.desktop",
> "appname":"Banshee Music Player",
> "title":"Stuart's Testing Trophy",
> "iconpath":"",
> "priority": 1,
> "unlocked": "False",
> "stockicon":"",
> "desc": {
> "1": {
> "lang":"en-us",
> "desc": "Listen to Music alot"
> },
> "2": {
> "lang":"en-uk",
> "desc": "Listen to Music a lot, a lot"
> }
> }
> }
>
> This is pretty cool. Having looked at it a bit, I have a couple of
> suggestions for the format:
>
> {
> "id":"sil-testing-trophy",
> "setname":"Testing",
> "seticon": "",
> "app":"application://banshee.desktop",
> // remove appname
> "title":"Stuart's Testing Trophy",
> // make iconpath be an attachment
> // remove priority
> // remove unlocked
> "stockicon":"",
> "desc": {
> "default": { // add default key
> "desc": "Listen to Music alot"
> },
> "en-us": { // make lang the key
> "desc": "Listen to Music alot"
> },
> "en-uk": {
> "desc": "Listen to Music a lot, a lot"
> }
> }
> }
>
> Some notes on what the suggested changes actually mean:
>
> // remove appname
> It's probably best to look up the appname from the .desktop file when you
> need it, because then you'll get translated names, and because if the app
> changes its name you won't know
> // make iconpath be an attachment
> If you're storing data in desktopcouch, then a good way to store the icon
> for the trophy (if it's not a stock icon) is as an attachment to the
> desktopcouch record; that way, the icon follows the rest of the data around
> between machines and to websites and so on
> // remove priority
> I, personally, would suggest that all trophies are of the same priority as
> far as notify-osd is concerned. Things like a trophy award aren't really of
> critical priority; critical priority is for things like "your laptop will
> shut down in 30 seconds" :-)
> // remove unlocked
> Ideally you wouldn't need "unlocked" because that question is really "is
> there an award record for this person for this trophy", which is really
> quick to ask
> // make lang the key
> There may be a reason I haven't seen, but it might be best to use the
> language as the key to the desc dictionary; that way, finding a description
> for a language is quick (if you have numbers as the keys then to find the
> desc for "en-uk" you have to iterate through the whole dictionary until you
> find it)
> // add default key
> Of course, you'll want a default desc for where there isn't a translation
> for your language
>
> Just suggestions, but I quite like cheers so I thought I'd give you my
> thoughts.
>
>
>
I completely agree with your points there, +1 from me :)