[DEV] continue integration of picture
This commit is contained in:
parent
26843381d7
commit
3e8524feb2
@ -194,7 +194,7 @@ int main(int _argc, const char *_argv[]) {
|
|||||||
ememory::SharedPtr<zeus::File> tmp = zeus::File::create("./testImage.png");
|
ememory::SharedPtr<zeus::File> tmp = zeus::File::create("./testImage.png");
|
||||||
//ememory::SharedPtr<zeus::File> tmp = zeus::File::create("./test_log.txt");
|
//ememory::SharedPtr<zeus::File> tmp = zeus::File::create("./test_log.txt");
|
||||||
int32_t size = tmp->getSize();
|
int32_t size = tmp->getSize();
|
||||||
auto retSendImage = remoteServicePicture.addFile(tmp).wait();
|
auto retSendImage = remoteServicePicture.mediaAdd(tmp).wait();
|
||||||
echrono::Steady stop = echrono::Steady::now();
|
echrono::Steady stop = echrono::Steady::now();
|
||||||
APPL_WARNING(" IO*=" << (stop-start) << " " << retSendImage.get());
|
APPL_WARNING(" IO*=" << (stop-start) << " " << retSendImage.get());
|
||||||
double megaParSec = double(size)/(double((stop-start).count())/1000000000.0);
|
double megaParSec = double(size)/(double((stop-start).count())/1000000000.0);
|
||||||
|
@ -27,20 +27,30 @@
|
|||||||
static std::mutex g_mutex;
|
static std::mutex g_mutex;
|
||||||
static std::string g_basePath;
|
static std::string g_basePath;
|
||||||
static std::string g_baseDBName = std::string(SERVICE_NAME) + "-database.json";
|
static std::string g_baseDBName = std::string(SERVICE_NAME) + "-database.json";
|
||||||
static ejson::Document g_database;
|
|
||||||
class FileProperty {
|
class FileProperty {
|
||||||
public:
|
public:
|
||||||
|
uint64_t m_id; //!< use local reference ID to have faster access on the file ...
|
||||||
std::string m_fileName; // Sha 512
|
std::string m_fileName; // Sha 512
|
||||||
std::string m_name;
|
std::string m_name;
|
||||||
std::string m_mineType;
|
std::string m_mineType;
|
||||||
echrono::Time m_creationData;
|
echrono::Time m_creationData;
|
||||||
};
|
};
|
||||||
|
|
||||||
static std::vector<FileProperty> m_listFile;
|
static std::vector<FileProperty> m_listFile;
|
||||||
|
|
||||||
|
class Album {
|
||||||
|
public:
|
||||||
|
uint32_t m_id; //!< use local reference ID to have faster access on the file ...
|
||||||
|
uint32_t m_parentId; //!< parent Album ID
|
||||||
|
std::string m_name; //!< name of the Album
|
||||||
|
std::string m_description; //!< description of the album
|
||||||
|
std::vector<uint64_t> m_listMedia; //!< List of media in this album
|
||||||
|
};
|
||||||
|
static std::vector<Album> m_listAlbum;
|
||||||
|
|
||||||
static uint64_t m_lastMaxId = 0;
|
static uint64_t m_lastMaxId = 0;
|
||||||
static bool g_needToStore = false;
|
static bool g_needToStore = false;
|
||||||
|
|
||||||
static uint64_t createFileID() {
|
static uint64_t createUniqueID() {
|
||||||
m_lastMaxId++;
|
m_lastMaxId++;
|
||||||
return m_lastMaxId;
|
return m_lastMaxId;
|
||||||
}
|
}
|
||||||
@ -66,6 +76,7 @@ namespace appl {
|
|||||||
APPL_VERBOSE("delete PictureService ...");
|
APPL_VERBOSE("delete PictureService ...");
|
||||||
}
|
}
|
||||||
public:
|
public:
|
||||||
|
#if 0
|
||||||
std::vector<std::string> getAlbums() {
|
std::vector<std::string> getAlbums() {
|
||||||
std::unique_lock<std::mutex> lock(g_mutex);
|
std::unique_lock<std::mutex> lock(g_mutex);
|
||||||
std::vector<std::string> out;
|
std::vector<std::string> out;
|
||||||
@ -176,8 +187,20 @@ namespace appl {
|
|||||||
}
|
}
|
||||||
return out;
|
return out;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
uint32_t mediaIdCount() {
|
||||||
|
std::unique_lock<std::mutex> lock(g_mutex);
|
||||||
|
// TODO : Check right ...
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
std::vector<std::string> mediaIdGetName(uint32_t _start, uint32_t _stop) {
|
||||||
|
std::unique_lock<std::mutex> lock(g_mutex);
|
||||||
|
// TODO : Check right ...
|
||||||
|
|
||||||
|
}
|
||||||
// Return a File Data (might be a picture .tiff/.png/.jpg)
|
// Return a File Data (might be a picture .tiff/.png/.jpg)
|
||||||
ememory::SharedPtr<zeus::File> getAlbumPicture(std::string _mediaName) {
|
ememory::SharedPtr<zeus::File> mediaGet(std::string _mediaName) {
|
||||||
std::unique_lock<std::mutex> lock(g_mutex);
|
std::unique_lock<std::mutex> lock(g_mutex);
|
||||||
// TODO : Check right ...
|
// TODO : Check right ...
|
||||||
//Check if the file exist:
|
//Check if the file exist:
|
||||||
@ -194,32 +217,8 @@ namespace appl {
|
|||||||
throw std::invalid_argument("Wrong file name ...");
|
throw std::invalid_argument("Wrong file name ...");
|
||||||
}
|
}
|
||||||
return zeus::File::create(g_basePath + property.m_fileName + "." + zeus::getExtention(property.m_mineType), "", property.m_mineType);
|
return zeus::File::create(g_basePath + property.m_fileName + "." + zeus::getExtention(property.m_mineType), "", property.m_mineType);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//uint64_t id = etk::string_to_uint64_t(_pictureName);
|
|
||||||
//APPL_WARNING("try to get file : " << _pictureName << " with id=" << id);
|
|
||||||
{
|
|
||||||
/*
|
|
||||||
auto it = m_listFile.find(id);
|
|
||||||
if (it != m_listFile.end()) {
|
|
||||||
return zeus::File::create(g_basePath + it->second);
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
}
|
|
||||||
/*
|
|
||||||
for (auto &it : m_listFile) {
|
|
||||||
APPL_WARNING("compare: " << it.first << " with " << id << " " << it.second);
|
|
||||||
if (it.first == id) {
|
|
||||||
return zeus::File::create(g_basePath + it.second);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
APPL_ERROR(" ==> Not find ...");
|
|
||||||
return nullptr;
|
|
||||||
}
|
}
|
||||||
std::string addFile(zeus::ProxyFile _dataFile) {
|
std::string mediaAdd(zeus::ProxyFile _dataFile) {
|
||||||
std::unique_lock<std::mutex> lock(g_mutex);
|
std::unique_lock<std::mutex> lock(g_mutex);
|
||||||
// TODO : Check right ...
|
// TODO : Check right ...
|
||||||
uint64_t id = createFileID();
|
uint64_t id = createFileID();
|
||||||
@ -241,79 +240,174 @@ namespace appl {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
// move the file at the good position:
|
// move the file at the good position:
|
||||||
APPL_ERROR("move temporay file in : " << g_basePath << sha512String);
|
APPL_DEBUG("move temporay file in : " << g_basePath << sha512String);
|
||||||
|
if (etk::FSNodeGetSize(tmpFileName) == 0) {
|
||||||
|
APPL_ERROR("try to store an empty file");
|
||||||
|
throw std::runtime_error("file size == 0");
|
||||||
|
}
|
||||||
etk::FSNodeMove(tmpFileName, g_basePath + sha512String + "." + zeus::getExtention(futType.get()));
|
etk::FSNodeMove(tmpFileName, g_basePath + sha512String + "." + zeus::getExtention(futType.get()));
|
||||||
FileProperty property;
|
FileProperty property;
|
||||||
|
property.m_id = createUniqueID();
|
||||||
property.m_fileName = sha512String;
|
property.m_fileName = sha512String;
|
||||||
property.m_name = futName.get();
|
property.m_name = futName.get();
|
||||||
property.m_mineType = futType.get();
|
property.m_mineType = futType.get();
|
||||||
property.m_creationData = echrono::Time::now();
|
property.m_creationData = echrono::Time::now();
|
||||||
APPL_ERROR("Current Time : " << echrono::Time::now());
|
|
||||||
m_listFile.push_back(property);
|
m_listFile.push_back(property);
|
||||||
g_needToStore = true;
|
g_needToStore = true;
|
||||||
APPL_ERROR(" filename : " << sha512String);
|
APPL_DEBUG(" filename : " << sha512String);
|
||||||
return sha512String;
|
return sha512String;
|
||||||
}
|
}
|
||||||
/*
|
void mediaRemove(std::string _mediaName) {
|
||||||
// Return a global UTC time
|
|
||||||
zeus::Time getAlbumPictureTime(std::string _pictureName) {
|
|
||||||
return m_user->getAlbumPictureTime(_pictureName);
|
|
||||||
}
|
|
||||||
// Return a Geolocalization information (latitude, longitude)
|
|
||||||
zeus::Geo getAlbumPictureGeoLocalization(std::string _pictureName) {
|
|
||||||
return m_user->getAlbumPictureGeoLocalization(_pictureName);
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
bool removeFile(std::string _file) {
|
|
||||||
std::unique_lock<std::mutex> lock(g_mutex);
|
std::unique_lock<std::mutex> lock(g_mutex);
|
||||||
// TODO : Check right ...
|
// TODO : Check right ...
|
||||||
return false;
|
//Check if the file exist:
|
||||||
|
bool find = false;
|
||||||
|
FileProperty property;
|
||||||
|
for (auto &it : m_listFile) {
|
||||||
|
if (it.m_fileName == _mediaName) {
|
||||||
|
find = true;
|
||||||
|
property = it;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (find == false) {
|
||||||
|
throw std::invalid_argument("Wrong file name ...");
|
||||||
|
}
|
||||||
|
if (etk::FSNodeRemove(g_basePath + _mediaName + "." + zeus::getExtention(property.m_mineType)) == false) {
|
||||||
|
throw std::runtime_error("Can not remove file ...");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string createAlbum(std::string _name) {
|
std::vector<std::string> mediaMetadataGetKeys(std::string _mediaName) {
|
||||||
std::unique_lock<std::mutex> lock(g_mutex);
|
std::vector<std::string> out;
|
||||||
// TODO : Check right ...
|
return out;
|
||||||
|
}
|
||||||
|
std::string mediaMetadataGetKey(std::string _mediaName, std::string _key) {
|
||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
bool removeAlbum(std::string _name) {
|
void mediaMetadataSetKey(std::string _name, std::string _key, std::string _value) {
|
||||||
std::unique_lock<std::mutex> lock(g_mutex);
|
|
||||||
// TODO : Check right ...
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
bool setAlbumDescription(std::string _name, std::string _desc) {
|
uint32_t albumCreate(std::string _albumName) {
|
||||||
std::unique_lock<std::mutex> lock(g_mutex);
|
std::unique_lock<std::mutex> lock(g_mutex);
|
||||||
// TODO : Check right ...
|
// TODO : Check right ...
|
||||||
return false;
|
for (auto &it : m_listAlbum) {
|
||||||
|
if (it.m_name == _albumName) {
|
||||||
|
return it.m_id;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Album album;
|
||||||
|
album.m_id = createUniqueID();
|
||||||
|
album.m_name = _albumName;
|
||||||
|
m_listAlbum.push_back(album);
|
||||||
|
return album.m_id;
|
||||||
}
|
}
|
||||||
std::string getAlbumDescription(std::string _name) {
|
|
||||||
|
|
||||||
|
class Album {
|
||||||
|
public:
|
||||||
|
uint64_t m_id; //!< use local reference ID to have faster access on the file ...
|
||||||
|
uint64_t m_parentId; //!< parent Album ID
|
||||||
|
std::string m_name; //!< name of the Album
|
||||||
|
std::string m_description; //!< description of the album
|
||||||
|
std::vector<uint64_t> m_listMedia; //!< List of media in this album
|
||||||
|
};
|
||||||
|
static std::vector<Album> m_listAlbum;
|
||||||
|
|
||||||
|
|
||||||
|
void albumRemove(uint32_t _albumId) {
|
||||||
std::unique_lock<std::mutex> lock(g_mutex);
|
std::unique_lock<std::mutex> lock(g_mutex);
|
||||||
// TODO : Check right ...
|
// TODO : Check right ...
|
||||||
|
for (auto it = m_listAlbum.begin();
|
||||||
|
it != m_listAlbum.end();
|
||||||
|
/* No increment */) {
|
||||||
|
if (it->m_id == _albumId) {
|
||||||
|
it = m_listAlbum.erase(it);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
++it;
|
||||||
|
}
|
||||||
|
throw std::invalid_argument("Wrong Album ID ...");
|
||||||
|
}
|
||||||
|
std::vector<uint32_t> albumGetList() {
|
||||||
|
std::unique_lock<std::mutex> lock(g_mutex);
|
||||||
|
std::vector<uint32_t> out;
|
||||||
|
for (auto &it : m_listAlbum) {
|
||||||
|
out.push_back(it.m_id);
|
||||||
|
}
|
||||||
|
return out;
|
||||||
|
}
|
||||||
|
std::string albumNameGet(uint32_t _albumId) {
|
||||||
|
std::unique_lock<std::mutex> lock(g_mutex);
|
||||||
|
for (auto &it : m_listAlbum) {
|
||||||
|
if (it.m_id == _albumId) {
|
||||||
|
return it.m_name;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
throw std::invalid_argument("Wrong Album ID ...");
|
||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
bool addInAlbum(std::string _nameAlbum, std::string _nameElement) {
|
void albumNameSet(uint32_t _albumId, std::string _albumName) {
|
||||||
std::unique_lock<std::mutex> lock(g_mutex);
|
std::unique_lock<std::mutex> lock(g_mutex);
|
||||||
// TODO : Check right ...
|
for (auto &it : m_listAlbum) {
|
||||||
return false;
|
if (it.m_id == _albumId) {
|
||||||
|
it.m_name = _albumName;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
throw std::invalid_argument("Wrong Album ID ...");
|
||||||
}
|
}
|
||||||
bool removeFromAlbum(std::string _nameAlbum, std::string _nameElement) {
|
std::string albumDescriptionGet(uint32_t _albumId) {
|
||||||
std::unique_lock<std::mutex> lock(g_mutex);
|
std::unique_lock<std::mutex> lock(g_mutex);
|
||||||
// TODO : Check right ...
|
for (auto &it : m_listAlbum) {
|
||||||
return false;
|
if (it.m_id == _albumId) {
|
||||||
|
return it.m_description;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
throw std::invalid_argument("Wrong Album ID ...");
|
||||||
|
return "";
|
||||||
}
|
}
|
||||||
/*
|
void albumDescriptionSet(uint32_t _albumId, std::string _desc) {
|
||||||
// Return a global UTC time
|
|
||||||
zeus::Time getAlbumPictureTime(std::string _pictureName) {
|
|
||||||
std::unique_lock<std::mutex> lock(g_mutex);
|
std::unique_lock<std::mutex> lock(g_mutex);
|
||||||
// TODO : Check right ...
|
for (auto &it : m_listAlbum) {
|
||||||
return zeus::Time();
|
if (it.m_id == _albumId) {
|
||||||
|
it.m_description = _desc;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
throw std::invalid_argument("Wrong Album ID ...");
|
||||||
}
|
}
|
||||||
// Return a Geolocalization information (latitude, longitude)
|
void albumMediaAdd(uint32_t _albumId, std::string _mediaName) {
|
||||||
zeus::Geo getAlbumPictureGeoLocalization(std::string _pictureName) {
|
|
||||||
|
}
|
||||||
|
void albumMediaRemove(uint32_t _albumId, std::string _mediaName) {
|
||||||
|
|
||||||
|
}
|
||||||
|
uint32_t albumMediaCount(uint32_t _albumId) {
|
||||||
std::unique_lock<std::mutex> lock(g_mutex);
|
std::unique_lock<std::mutex> lock(g_mutex);
|
||||||
// TODO : Check right ...
|
for (auto &it : m_listAlbum) {
|
||||||
return zeus::Geo();
|
if (it.m_id == _albumId) {
|
||||||
|
it.m_description = _desc;
|
||||||
|
return it.m_listMedia.count();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
throw std::invalid_argument("Wrong Album ID ...");
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
std::vector<std::string> albumMediaGetName(uint32_t _albumId, uint32_t _start, uint32_t _stop) {
|
||||||
|
std::vector<std::string> out;
|
||||||
|
|
||||||
|
return out;
|
||||||
|
}
|
||||||
|
void albumParentSet(uint32_t _albumId, uint32_t _albumParentId) {
|
||||||
|
|
||||||
|
}
|
||||||
|
void albumParentRemove(uint32_t _albumId) {
|
||||||
|
|
||||||
|
}
|
||||||
|
uint32_t albumParentGet(uint32_t _albumId) {
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
*/
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -324,11 +418,27 @@ static void store_db() {
|
|||||||
database.add("list-files", listFilesArray);
|
database.add("list-files", listFilesArray);
|
||||||
for (auto &it : m_listFile) {
|
for (auto &it : m_listFile) {
|
||||||
ejson::Object fileElement;
|
ejson::Object fileElement;
|
||||||
|
listFilesArray.add(fileElement);
|
||||||
|
fileElement.add("id", ejson::Number(it.m_id));
|
||||||
fileElement.add("file-name", ejson::String(it.m_fileName));
|
fileElement.add("file-name", ejson::String(it.m_fileName));
|
||||||
fileElement.add("name", ejson::String(it.m_name));
|
fileElement.add("name", ejson::String(it.m_name));
|
||||||
fileElement.add("mine-type", ejson::String(it.m_mineType));
|
fileElement.add("mine-type", ejson::String(it.m_mineType));
|
||||||
fileElement.add("add-date", ejson::Number(it.m_creationData.count()));
|
fileElement.add("add-date", ejson::Number(it.m_creationData.count()));
|
||||||
listFilesArray.add(fileElement);
|
}
|
||||||
|
ejson::Array listAlbumArray;
|
||||||
|
database.add("list-album", listAlbumArray);
|
||||||
|
for (auto &it : m_listAlbum) {
|
||||||
|
ejson::Object albumElement;
|
||||||
|
listAlbumArray.add(AlbumElement);
|
||||||
|
albumElement.add("id", ejson::Number(it.m_id));
|
||||||
|
albumElement.add("parent", ejson::Number(it.m_parentId));
|
||||||
|
albumElement.add("name", ejson::String(it.m_name));
|
||||||
|
albumElement.add("desc", ejson::String(it.m_description));
|
||||||
|
ejson::Array listMediaArray;
|
||||||
|
albumElement.add("media", listMediaArray);
|
||||||
|
for (auto &it2 : it.m_listMedia) {
|
||||||
|
listMediaArray.add(ejson::Number(it2));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
bool retGenerate = database.storeSafe(g_basePath + g_baseDBName);
|
bool retGenerate = database.storeSafe(g_basePath + g_baseDBName);
|
||||||
APPL_ERROR("Store database [STOP] : " << (g_basePath + g_baseDBName) << " ret = " << retGenerate);
|
APPL_ERROR("Store database [STOP] : " << (g_basePath + g_baseDBName) << " ret = " << retGenerate);
|
||||||
@ -345,18 +455,35 @@ static void load_db() {
|
|||||||
for (const auto itArray: listFilesArray) {
|
for (const auto itArray: listFilesArray) {
|
||||||
ejson::Object fileElement = itArray.toObject();
|
ejson::Object fileElement = itArray.toObject();
|
||||||
FileProperty property;
|
FileProperty property;
|
||||||
|
property.m_id = fileElement["id"].toNumber().getU64();
|
||||||
property.m_fileName = fileElement["file-name"].toString().get();
|
property.m_fileName = fileElement["file-name"].toString().get();
|
||||||
property.m_name = fileElement["name"].toString().get();
|
property.m_name = fileElement["name"].toString().get();
|
||||||
property.m_mineType = fileElement["mine-type"].toString().get();
|
property.m_mineType = fileElement["mine-type"].toString().get();
|
||||||
property.m_creationData = echrono::Time(fileElement["add-date"].toNumber().getU64()*1000);
|
property.m_creationData = echrono::Time(fileElement["add-date"].toNumber().getU64()*1000);
|
||||||
|
if (m_lastMaxId < property.m_id) {
|
||||||
|
m_lastMaxId = property.m_id+1;
|
||||||
|
}
|
||||||
if (property.m_fileName == "") {
|
if (property.m_fileName == "") {
|
||||||
APPL_ERROR("Can not access on the file : ... No name ");
|
APPL_ERROR("Can not access on the file : ... No name ");
|
||||||
} else {
|
} else {
|
||||||
m_listFile.push_back(property);
|
m_listFile.push_back(property);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
ejson::Array listAlbumArray = database["list-album"].toArray();
|
||||||
|
for (const auto itArray: listAlbumArray) {
|
||||||
|
ejson::Object albumElement = itArray.toObject();
|
||||||
|
Album album;
|
||||||
|
album.m_id = albumElement["id"].toNumber().getU64();
|
||||||
|
album.m_parentId = albumElement["parent"].toNumber().getU64()
|
||||||
|
album.m_name = albumElement["name"].toString().get();
|
||||||
|
album.m_description = albumElement["desc"].toString().get();
|
||||||
|
ejson::Array listMadiaArray = database["list-album"].toArray();
|
||||||
|
for (const auto itArrayMedia: listAlbumArray) {
|
||||||
|
uint64_t tmp = itArrayMedia.toNumber().getU64();
|
||||||
|
album.m_listMedia.push_back(tmp);
|
||||||
|
}
|
||||||
|
m_listAlbum.push_back(album);
|
||||||
|
}
|
||||||
g_needToStore = false;
|
g_needToStore = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -5,14 +5,6 @@
|
|||||||
|
|
||||||
import zeus-File
|
import zeus-File
|
||||||
|
|
||||||
vector:string getAlbums()
|
|
||||||
vector:string getSubAlbums(string)
|
|
||||||
uint32 getAlbumCount(string)
|
|
||||||
vector:string getAlbumListPicture(string)
|
|
||||||
//obj:zeus-File getAlbumPicture(string)
|
|
||||||
string addFile(obj:zeus-File)
|
|
||||||
bool removeFile(string)
|
|
||||||
/*
|
|
||||||
// ----------------- Get media with their ID -----------------------
|
// ----------------- Get media with their ID -----------------------
|
||||||
#brief:Get the number of media availlable (a media is a picture or a video)
|
#brief:Get the number of media availlable (a media is a picture or a video)
|
||||||
#return: Number of media
|
#return: Number of media
|
||||||
@ -24,6 +16,7 @@ uint32 mediaIdCount()
|
|||||||
#return:List of the media names
|
#return:List of the media names
|
||||||
vector:string mediaIdGetName(uint32,uint32)
|
vector:string mediaIdGetName(uint32,uint32)
|
||||||
|
|
||||||
|
/*
|
||||||
// ----------------- Get media with their ID in a range of time -----------------------
|
// ----------------- Get media with their ID in a range of time -----------------------
|
||||||
#brief:Get the number of media availlable in a range of time
|
#brief:Get the number of media availlable in a range of time
|
||||||
#param:timeStart:First time that the element is requested
|
#param:timeStart:First time that the element is requested
|
||||||
@ -38,32 +31,34 @@ uint32 mediaTimeCount(time, time)
|
|||||||
#param:stop:Last Id of the media stream requested (excluded) (range [0..+inf[)
|
#param:stop:Last Id of the media stream requested (excluded) (range [0..+inf[)
|
||||||
#return:List of the media names
|
#return:List of the media names
|
||||||
vector:string mediaTimeGetName(time, time, uint32,uint32)
|
vector:string mediaTimeGetName(time, time, uint32,uint32)
|
||||||
|
*/
|
||||||
// ----------------- media Access -----------------------
|
// ----------------- media Access -----------------------
|
||||||
#brief:Get a media
|
#brief:Get a media
|
||||||
#param:mediaName:Name of the media
|
#param:mediaName:Name of the media
|
||||||
#return:A file reference on the media (transmission is async)
|
#return:A file reference on the media (transmission is async)
|
||||||
file mediaGet(string)
|
obj:zeus-File mediaGet(string)
|
||||||
|
/*
|
||||||
#brief:Get a media in STREAM mode (usefull for video)
|
#brief:Get a media in STREAM mode (usefull for video)
|
||||||
#param:mediaName:Name of the media
|
#param:mediaName:Name of the media
|
||||||
#return:A stream reference on the media (transmission is async)
|
#return:A stream reference on the media (transmission is async)
|
||||||
stream mediaStream(string)
|
obj::zeus-Stream mediaStream(string)
|
||||||
|
*/
|
||||||
#brief:Add a new media in the service
|
#brief:Add a new media in the service
|
||||||
#param:data:A file reference on the media (transmission is async)
|
#param:data:A file reference on the media (transmission is async)
|
||||||
#return:Full name of the media (created by the engine ==> not prefictible)
|
#return:Full name of the media (created by the engine ==> not prefictible)
|
||||||
string mediaAdd(file)
|
string mediaAdd(obj:zeus-File)
|
||||||
|
|
||||||
#brief:Remove a media in the service (no trash)
|
#brief:Remove a media in the service (no trash)
|
||||||
#param:mediaName:Name of the media
|
#param:mediaName:Name of the media
|
||||||
void mediaRemove(string)
|
void mediaRemove(string)
|
||||||
|
|
||||||
// ----------------- meta-data Access -----------------------
|
// ----------------- meta-data Access -----------------------
|
||||||
|
/*
|
||||||
#brief:Get all meta-data of a media
|
#brief:Get all meta-data of a media
|
||||||
#param:mediaName:Name of the media
|
#param:mediaName:Name of the media
|
||||||
#return:a json description of the metadata
|
#return:a json description of the metadata
|
||||||
json mediaMetadataGet(string)
|
json mediaMetadataGet(string)
|
||||||
|
*/
|
||||||
|
|
||||||
#brief:Get all meta-data keys of a media
|
#brief:Get all meta-data keys of a media
|
||||||
#param:mediaName:Name of the media
|
#param:mediaName:Name of the media
|
||||||
@ -82,63 +77,78 @@ string mediaMetadataGetKey(string, string)
|
|||||||
#param:value:data in the key
|
#param:value:data in the key
|
||||||
void mediaMetadataSetKey(string, string, string)
|
void mediaMetadataSetKey(string, string, string)
|
||||||
|
|
||||||
#brief:Get all meta-data of a media
|
/*
|
||||||
|
#brief:Set all meta-data of a media
|
||||||
#param:name:Name of the media
|
#param:name:Name of the media
|
||||||
#param:description: a json description of the metadata
|
#param:description: a json description of the metadata
|
||||||
void mediaMetadataGet(string, json)
|
void mediaMetadataGet(string, json)
|
||||||
|
*/
|
||||||
|
|
||||||
// ----------------- Album Access -----------------------
|
// ----------------- Album Access -----------------------
|
||||||
#brief: Create an album
|
#brief: Create an album
|
||||||
#param:albumName:Name of the Album
|
#param:albumName:Name of the Album
|
||||||
#return:Id of the album
|
#return:Id of the album
|
||||||
uint32 albumCreate(string)
|
uint32 albumCreate(string)
|
||||||
|
|
||||||
#brief: Remove an album
|
#brief: Remove an album
|
||||||
#param:albumId:Id of the Album
|
#param:albumId:Id of the Album
|
||||||
void albumRemove(uint32)
|
void albumRemove(uint32)
|
||||||
|
|
||||||
#brief:Get list of Id of all albums
|
#brief:Get list of Id of all albums
|
||||||
#return:List of all Id of the albums
|
#return:List of all Id of the albums
|
||||||
vector:uint32 albumGetList()
|
vector:uint32 albumGetList()
|
||||||
|
|
||||||
#brief:Get the name of the album
|
#brief:Get the name of the album
|
||||||
#param:albumId:Id of the Album
|
#param:albumId:Id of the Album
|
||||||
#return:Name of the Album
|
#return:Name of the Album
|
||||||
string albumNameGet(uint32)
|
string albumNameGet(uint32)
|
||||||
|
|
||||||
#brief:Set the name of the album
|
#brief:Set the name of the album
|
||||||
#param:albumId:Id of the Album
|
#param:albumId:Id of the Album
|
||||||
#param:albumName:Name of the Album
|
#param:albumName:Name of the Album
|
||||||
void albumNameSet(uint32, string)
|
void albumNameSet(uint32, string)
|
||||||
|
|
||||||
#brief:Get the description of the album
|
#brief:Get the description of the album
|
||||||
#param:albumId:Id of the Album
|
#param:albumId:Id of the Album
|
||||||
#return:Description of the Album
|
#return:Description of the Album
|
||||||
string albumDescriptionGet(uint32)
|
string albumDescriptionGet(uint32)
|
||||||
|
|
||||||
#brief:Set the description of the album
|
#brief:Set the description of the album
|
||||||
#param:albumId:Id of the Album
|
#param:albumId:Id of the Album
|
||||||
#param:desc:Description of the Album
|
#param:desc:Description of the Album
|
||||||
void albumDescriptionSet(uint32, string)
|
void albumDescriptionSet(uint32, string)
|
||||||
|
|
||||||
#brief:Add a media in an album
|
#brief:Add a media in an album
|
||||||
#param:albumId:Id of the Album
|
#param:albumId:Id of the Album
|
||||||
#param:mediaName:Name of the media to add
|
#param:mediaName:Name of the media to add
|
||||||
void albumMediaAdd(uint32, string)
|
void albumMediaAdd(uint32, string)
|
||||||
|
|
||||||
#brief:Remove a media in an album
|
#brief:Remove a media in an album
|
||||||
#param:albumId:Id of the Album
|
#param:albumId:Id of the Album
|
||||||
#param:mediaName:Name of the media to remove
|
#param:mediaName:Name of the media to remove
|
||||||
void albumMediaRemove(uint32, string)
|
void albumMediaRemove(uint32, string)
|
||||||
|
|
||||||
#brief:Get number of media in an album
|
#brief:Get number of media in an album
|
||||||
#param:albumId:Id of the Album
|
#param:albumId:Id of the Album
|
||||||
#return:Number of medias
|
#return:Number of medias
|
||||||
uint32 albumMediaCount(uint32)
|
uint32 albumMediaCount(uint32)
|
||||||
|
|
||||||
#brief:Get list of name of the media in a specific range (<1024)
|
#brief:Get list of name of the media in a specific range (<1024)
|
||||||
#param:albumId:Id of the Album
|
#param:albumId:Id of the Album
|
||||||
#param:start:First Id of the media stream requested (range [0..+inf[)
|
#param:start:First Id of the media stream requested (range [0..+inf[)
|
||||||
#param:stop:Last Id of the media stream requested (excluded) (range [0..+inf[)
|
#param:stop:Last Id of the media stream requested (excluded) (range [0..+inf[)
|
||||||
#return:List of the media names
|
#return:List of the media names
|
||||||
vector:string albumMediaGetName(uint32, uint32,uint32)
|
vector:string albumMediaGetName(uint32, uint32,uint32)
|
||||||
|
|
||||||
#brief:Set the parrent album at a specific album
|
#brief:Set the parrent album at a specific album
|
||||||
#param:albumId:Id of the Album
|
#param:albumId:Id of the Album
|
||||||
#param:albumParentId:Id of the parent Album
|
#param:albumParentId:Id of the parent Album
|
||||||
void albumParentSet(uint32, uint32)
|
void albumParentSet(uint32, uint32)
|
||||||
|
|
||||||
#brief:Remove the parrent album at a specific album
|
#brief:Remove the parrent album at a specific album
|
||||||
#param:albumId:Id of the Album
|
#param:albumId:Id of the Album
|
||||||
void albumParentRemove(uint32)
|
void albumParentRemove(uint32)
|
||||||
|
|
||||||
#brief:Get the parrent album at a specific album
|
#brief:Get the parrent album at a specific album
|
||||||
#param:albumId:Id of the Album
|
#param:albumId:Id of the Album
|
||||||
uint32 albumParentGet(uint32)
|
uint32 albumParentGet(uint32)
|
||||||
@ -148,4 +158,3 @@ uint32 albumParentGet(uint32)
|
|||||||
|
|
||||||
// ----------------- Media Right Access -----------------------
|
// ----------------- Media Right Access -----------------------
|
||||||
|
|
||||||
*/
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user