Skip to content
This repository was archived by the owner on Mar 2, 2021. It is now read-only.

Commit 6b75bbe

Browse files
authored
Merge pull request #55 from internet4000/chore/img-doc
add quick img doc
2 parents 3163446 + ced0417 commit 6b75bbe

File tree

1 file changed

+24
-9
lines changed

1 file changed

+24
-9
lines changed

README.md

Lines changed: 24 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ Requires authentication to write.
105105
|channelPublic|`belongsTo`|relationship to a `channelPublic`. Example: `"-JoJm13j3aGTWCT_Zbir"`|
106106
|created|`integer`|timestamp describing when was this radio channel created. Example: `"1411213745028"`|
107107
|favoriteChannels|`hasMany`|list of channels this radio has added as favorite. Example: `"-JXHtCxC9Ew-Ilck6iZ8": true`|
108-
|images|`hasMany`|list of `image` models. Example: `"-JoJypAujT2z0qcWnYjW": true`|
108+
|image|`string`|the id for the cloudinary `image` model. Example: `"image": "drz0qs9lgscyfdztr17t". See Image section for more info`|
109109
|isFeatured|`boolean`|whether this channel is featured on Radio4000's homepage. Example: `false`|
110110
|link|`string`|Custom URL describing the external homepage for a radio channel. Example: `"https://example.com"`|
111111
|slug|`string`|the unique URL representing this channel. Used for human readable urls radio4000.com/pirate-radio). Example: `"pirate-radio"`|
@@ -122,14 +122,6 @@ Requires authentication to write.
122122
|channel|`belongsTo`|relationship to a `channel` model. Example: `"-JYEosmvT82Ju0vcSHVP"`|
123123
|followers|`hasMany`|list of `channel` models following this radio. Example: `{"-JXHtCxC9Ew-Ilck6iZ8": true, ...}`|
124124

125-
### Image
126-
127-
|name|type|description|
128-
|-|-|-|
129-
|channels|`belongsTo`|relationship to the `channel` model|
130-
|src|string|`id` of the `cloudinary` model which stores this image data.|
131-
132-
todo: explain our integration of the Cloudinary service.
133125

134126
### Track
135127

@@ -144,6 +136,29 @@ todo: explain our integration of the Cloudinary service.
144136
|mediaNotAvailable|`boolean`|is the current track media available, accessible to be consumed|
145137
|discogsUrl|`string`|the URL pointing to the Discogs release (or master) corresponding to this track media. Example: `"https://www.discogs.com/Nu-Guinea-Nuova-Napoli/master/1334042"`|
146138

139+
### Image
140+
141+
For simplicity reasons, and focus of usages, there is only one image
142+
for a radio channel.
143+
144+
In attent of a better solution, images are hosted at Cloudinary.
145+
146+
``` javascript
147+
let width = 500,
148+
height = 500,
149+
quality = 100,
150+
id = 'drz0qs9lgscyfdztr17t';
151+
152+
let base = `https://res.cloudinary.com/radio4000/image/upload/w_${width},h_${height},c_thumb,q_${quality}`;
153+
let image = `${base},fl_awebp/${id}.webp`;
154+
```
155+
156+
The whole API is described in details on the [Cloudinary
157+
documentation](https://cloudinary.com/documentation).
158+
159+
You can check how [Radio4000 uses it](https://github.com/internet4000/radio4000/blob/master/app/helpers/cover-img.js).
160+
161+
147162
## Node.js API
148163

149164
In addition to the Firebase API, this repository contains a node.js API in the `src` folder. This is what runs at https://api.radio4000.com. It is configured as a Firebase function. Remember to review the `.firebaserc` and `firebase.json` files.

0 commit comments

Comments
 (0)