changed the way how prefixes are added to urls

instead at the end we adding a prefix before an extension, e.g: filename_(2).jpg
This commit is contained in:
2021-02-25 00:12:45 +01:00
parent 51b1aed483
commit afbe82e9f4
4 changed files with 165 additions and 66 deletions

View File

@@ -50,6 +50,12 @@ public:
long size;
/*
* add an id of an item and compare it in 'update' method
* (in a case size==1)
*
*/
void map_fields()
{
field(L"size", size);
@@ -109,12 +115,6 @@ public:
*/
int sort_index;
/*
* may not needed?
* the id is in the ItemContent object
*/
long content_id;
/*
*
*/
@@ -139,19 +139,23 @@ public:
bool prepare_url();
/*
* CHECKME
* make sure update(...) methods from Model are not available
*/
bool insert(morm::ModelData * model_data, bool update_whole_tree = true);
bool insert(morm::ModelData & model_data, bool update_whole_tree = true);
bool insert(bool update_whole_tree = true);
bool update(morm::ModelData * model_data, bool url_was_changed, bool update_whole_tree = true);
bool update(morm::ModelData & model_data, bool url_was_changed, bool update_whole_tree = true);
bool update(bool url_was_changed, bool update_whole_tree = true);
// IMPROVEME make the same for save() methods
bool save(morm::ModelData * model_data, bool url_was_changed, bool save_whole_tree = true);
bool save(morm::ModelData & model_data, bool url_was_changed, bool save_whole_tree = true);
bool save(bool url_was_changed, bool save_whole_tree = true);
/*
* IMPROVEME
* when removing we should check whether the item_content.references is zero and them remove it
* when removing we should check whether the item_content.references is zero and then remove it
* in other cases only decrement item_content.references
*
*/
@@ -164,9 +168,6 @@ public:
protected:
bool url_was_prepared_correctly;
long calc_items_by_url(long parent_id, const std::wstring & url);