Loading plugins/media/media.cpp +6 −0 Changes for plugins/media/media.cpp: 6 added lines, 0 removed lines. Original line number Diff line number Diff line Loading @@ -1445,12 +1445,18 @@ namespace blogi { _ensureMdbReady(tid, token); std::string storeId = _getStoreId(tid, storeName); auto album = _mdb[tid]->create_album(storeId, albumName); json_object *jpub = nullptr; if(json_object_object_get_ex(request, "is_public", &jpub) && json_object_get_boolean(jpub)){ _mdb[tid]->set_album_public(album.id, true); album.is_public = true; } json_object_object_add(response, "status", json_object_new_string("success")); json_object *jal = json_object_new_object(); json_object_object_add(jal, "id", json_object_new_string(album.id.c_str())); json_object_object_add(jal, "name", json_object_new_string(album.name.c_str())); json_object_object_add(jal, "store", json_object_new_string(storeName)); json_object_object_add(jal, "media_count", json_object_new_int(album.media_count)); json_object_object_add(jal, "is_public", json_object_new_boolean(album.is_public)); json_object_object_add(response, "album", jal); } catch(std::exception &e) { json_object_object_add(response, "status", json_object_new_string("error")); Loading Loading
plugins/media/media.cpp +6 −0 Changes for plugins/media/media.cpp: 6 added lines, 0 removed lines. Original line number Diff line number Diff line Loading @@ -1445,12 +1445,18 @@ namespace blogi { _ensureMdbReady(tid, token); std::string storeId = _getStoreId(tid, storeName); auto album = _mdb[tid]->create_album(storeId, albumName); json_object *jpub = nullptr; if(json_object_object_get_ex(request, "is_public", &jpub) && json_object_get_boolean(jpub)){ _mdb[tid]->set_album_public(album.id, true); album.is_public = true; } json_object_object_add(response, "status", json_object_new_string("success")); json_object *jal = json_object_new_object(); json_object_object_add(jal, "id", json_object_new_string(album.id.c_str())); json_object_object_add(jal, "name", json_object_new_string(album.name.c_str())); json_object_object_add(jal, "store", json_object_new_string(storeName)); json_object_object_add(jal, "media_count", json_object_new_int(album.media_count)); json_object_object_add(jal, "is_public", json_object_new_boolean(album.is_public)); json_object_object_add(response, "album", jal); } catch(std::exception &e) { json_object_object_add(response, "status", json_object_new_string("error")); Loading