Suggested changes to the trophy data format
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Cheers |
In Progress
|
Medium
|
Cheers |
Bug Description
At the moment, the trophy data looks like this:
{
"id"
"setname"
"seticon": "",
"app"
"appname"
"title"
"iconpath":"",
"priority": 1,
"unlocked": "False",
"stockicon":"",
"desc": {
"1": {
"desc": "Listen to Music alot"
},
"2": {
"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"
"setname"
"seticon": "",
"app"
// remove appname
"title"
// 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.
Changed in cheers: | |
assignee: | Manish Sinha (manishsinha) → Cheers (cheers) |
status: | Confirmed → In Progress |
On Wed, Nov 3, 2010 at 1:30 AM, Stuart Langridge <
<email address hidden>> wrote:
> Public bug reported: testing- trophy" , :"Testing" , application: //banshee. desktop" , testing- trophy" , :"Testing" , application: //banshee. desktop" , /bugs.launchpad .net/bugs/ 670185
>
> At the moment, the trophy data looks like this:
> {
> "id":"sil-
> "setname"
> "seticon": "",
> "app":"
> "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-
> "setname"
> "seticon": "",
> "app":"
> // 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:/
> You received this bug notificatio...