Compare commits
6 Commits
159aac6a2e
...
dev
| Author | SHA1 | Date | |
|---|---|---|---|
| c2817fe0b3 | |||
| 94007dc7da | |||
|
|
7145a0b1cd | ||
| 77948e93b6 | |||
|
|
07cc31ede3 | ||
|
|
1051f05cce |
@@ -10,12 +10,12 @@
|
||||
"http://localhost"
|
||||
],
|
||||
"database": {
|
||||
"host": "localhost",
|
||||
"host": "database",
|
||||
"port": 27017,
|
||||
"name": "webplay"
|
||||
},
|
||||
"redis": {
|
||||
"host": "127.0.0.1",
|
||||
"host": "redis",
|
||||
"port": 6379
|
||||
},
|
||||
"album_cover_files": [
|
||||
|
||||
@@ -56,9 +56,9 @@ router
|
||||
if (radio) {
|
||||
if (req.files.file) {
|
||||
resize_image_for_radio(req.files.file.data, (result) => {
|
||||
radio.cover32 = result.cover32;
|
||||
radio.cover64 = result.cover64;
|
||||
radio.cover128 = result.cover128;
|
||||
radio.covers.cover32 = result.cover32;
|
||||
radio.covers.cover64 = result.cover64;
|
||||
radio.covers.cover128 = result.cover128;
|
||||
database.radios.update(radio);
|
||||
res.json(radio).end();
|
||||
});
|
||||
|
||||
@@ -13,6 +13,9 @@ exports.collection = function (callback) {
|
||||
.toArray((err, result) => {
|
||||
result.forEach(item => {
|
||||
item.type = "radio";
|
||||
if (!item.covers) {
|
||||
item.covers = {};
|
||||
}
|
||||
});
|
||||
callback(result);
|
||||
});
|
||||
@@ -23,6 +26,9 @@ exports.byId = function (id, callback) {
|
||||
.collection("radios")
|
||||
.findOne({ _id: ObjectId(id) }, (err, result) => {
|
||||
if (err) throw err;
|
||||
if (!result.covers) {
|
||||
result.covers = {};
|
||||
}
|
||||
callback(result);
|
||||
});
|
||||
};
|
||||
@@ -63,9 +69,7 @@ exports.update = function (radio, callback) {
|
||||
$set: {
|
||||
name: radio.name,
|
||||
url: radio.url,
|
||||
cover32: radio.cover32,
|
||||
cover64: radio.cover64,
|
||||
cover128: radio.cover128
|
||||
covers: radio.covers
|
||||
}
|
||||
},
|
||||
{ upsert: false },
|
||||
|
||||
Reference in New Issue
Block a user