Ghini / ghini.web

web and geo interface to ghini.desktop database
GNU Affero General Public License v3.0
4 stars 1 forks source link

let ghini.web serve gardens and panels for ghini.tour #32

Closed mfrasca closed 6 years ago

mfrasca commented 6 years ago

we do not want to distribute huge amount of data with ghini.tour, nor that every time we have a new panel, we need a new version of ghini.tour. we want to keep this information somewhere else, and one option is to keep it in ghini.web. so, my idea is to keep infopanels in ghini.web, more precisely in the database managed by ghini.web on ghini.me. I have tested the quality of the audio produced by pico2wave, and even worse espeak, and they're really not acceptable for professional distribution. so the data in the database would be the coordinates and the text id, while the audio would be next to it, available for download on demand.

mfrasca commented 6 years ago

should we put infopanels somewhere in www.ghini.me, or better a separate location, like panels.ghini.me? first is easier, second maybe looks better. amount of work marginally greater.

mfrasca commented 6 years ago

current code looks like:

var schema = new mongoose.Schema({});
var Garden = connection.model('garden', schema);
Garden.
 aggregate([ {$sort: {name:1}},
    {$lookup: {from:"infopanels", foreignField:"garden", localField:"name", as:"infopanels"}},
    {$project: {name:1, lat: 1, lon: 1, contact: 1,
        title: "$name",
        infopanels: {$size: "$infopanels"}}} ]).

which assumes that we have two collections, garden and infopanels, linked relationally by a foreign key.
a panel in the infopanels collection already has coordinates, title, and text. we need the name of the panel audio file. let's not compute it again, just save it as we've decided, that is: g_%(garden_id)03d_%(panel_id)03d.mp3. To make things clearer, we better save the garden_id in the garden document, even if we're not using it here in ghini.web.

mfrasca commented 6 years ago

we need the name of the panel audio file

even better: let's serve the URL of the audio panel. so when we change things in the ghini.web service and on the ghini.web server, we don't need any change in the clients.

where do we set the language? on the server? in the request? boh...