You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Mar 2, 2021. It is now read-only.
Copy file name to clipboardExpand all lines: README.md
+24-9Lines changed: 24 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -105,7 +105,7 @@ Requires authentication to write.
105
105
|channelPublic|`belongsTo`|relationship to a `channelPublic`. Example: `"-JoJm13j3aGTWCT_Zbir"`|
106
106
|created|`integer`|timestamp describing when was this radio channel created. Example: `"1411213745028"`|
107
107
|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`|
109
109
|isFeatured|`boolean`|whether this channel is featured on Radio4000's homepage. Example: `false`|
110
110
|link|`string`|Custom URL describing the external homepage for a radio channel. Example: `"https://example.com"`|
111
111
|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.
122
122
|channel|`belongsTo`|relationship to a `channel` model. Example: `"-JYEosmvT82Ju0vcSHVP"`|
123
123
|followers|`hasMany`|list of `channel` models following this radio. Example: `{"-JXHtCxC9Ew-Ilck6iZ8": true, ...}`|
124
124
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.
133
125
134
126
### Track
135
127
@@ -144,6 +136,29 @@ todo: explain our integration of the Cloudinary service.
144
136
|mediaNotAvailable|`boolean`|is the current track media available, accessible to be consumed|
145
137
|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"`|
146
138
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
You can check how [Radio4000 uses it](https://github.com/internet4000/radio4000/blob/master/app/helpers/cover-img.js).
160
+
161
+
147
162
## Node.js API
148
163
149
164
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