shaunrance / Verygd-Web-Portal

0 stars 0 forks source link

Straighten up naming of album/project #59

Open schkolne opened 7 years ago

schkolne commented 7 years ago

@jasonfarrell I'm noticing that in the webservice, we call the endpoint "albums" to get a list of all the user's projects. Each album is a list of images -- is this a scene? I'm already getting confused with my nomenclature of classes I'm writing on the Unity side to represent this.

Before we accumulate technical debt around this, let's clarify the scheme of data we'll be bringing down for the user. This is how I think it should work:

The users stuff in the webservice seems good. From that, we can get a user ID.

For a user, there is a method "projects" that returns a list of projects this user has permissions for, analogous to http://very.gd.ua5.land/projects -- this is currently "albums".

I note that when I parse albums, it is an array with children. Each child is a project.

Within each child, there is a key "content". I think this key should be renamed "scene" as it contains the content for a view (currently a list of images but - could change). I'm happy with the elements of "scene" to be loosely structured -- i notice there is an " "is_panorama" flag -- but better approach would be to utilize the "type" flag or something like it to have predefined types, e.g. "panel" and "panorama".

Please don't change anything yet (and let's not tackle this until after the demo). But let's keep things straight sooner rather than later before the layers of cruft start to accumulate. We should be disciplined about consistent naming in the web view code as well -- e.g. I notice there is a pano.js that should probably be called scene.js in this naming scheme (or alternately we could decide to use "pano" instead of "scene" everywhere). etc.