llaske / sugarizer

Sugarizer is a web implementation of the Sugar platform to run on any device or browser
https://sugarizer.org
Apache License 2.0
198 stars 411 forks source link

dev: wrong path to activity icon in API? #115

Closed bzg closed 7 years ago

bzg commented 7 years ago

http://dev.sugarizer.org/api/activities lists details of all activities.

I see "icon": "activity/activity-icon.svg" is each item, which does not seem correct.

llaske commented 7 years ago

No, it's not true. Some activities have a different path (Welcome web or EToys). But this file path is relative to the activity directory. To have the full icon path, you have to combine the activity directory and icon file path. Note that that this path is loaded from the activity/activity.info file of each activity. See the source code for this reading here: https://github.com/llaske/sugarizer/blob/master/server/routes/activities.js#L30

bzg commented 7 years ago

Thanks for the reply.

Just curious: is it useful to keep the "activities/" and "activity/" part in, respectively, the directory and the icon paths?

Are there cases where the activity directory is not in "activities/" directory and where the icon is not in the "activity/" directory?

llaske commented 7 years ago

Good question.

The name of the directory "activities" is a settings in the sugarizer.ini file so it can't be removed. The name of "activity" directory is inherited from Sugar but you're right it could be removed.

bzg commented 7 years ago

Thanks for the clarification!