diff --git a/src/util/item.cpp b/src/util/item.cpp index 2f951bf..8c12223 100644 --- a/src/util/item.cpp +++ b/src/util/item.cpp @@ -21,8 +21,14 @@ using namespace std; Item::Item(const string &xmlItem) { _path = Util::getXMLAttribute(xmlItem, "d:href"); - if (_path.find(NEXTCLOUD_END_PATH) != std::string::npos) - _path.erase(0, NEXTCLOUD_END_PATH.length()); + + //replaces everthing in front of /remote.php as this is already part of the url + Log::writeLog("path before transformation " + _path); + if(_path.find(NEXTCLOUD_START_PATH) != 0) + { + _path.erase(0,_path.find(NEXTCLOUD_START_PATH)); + Log::writeLog("path after transformation " + _path); + } _lastEditDate = Util::getXMLAttribute(xmlItem, "d:getlastmodified"); _title = _path; diff --git a/src/util/nextcloud.h b/src/util/nextcloud.h index 566501d..7f11c7d 100644 --- a/src/util/nextcloud.h +++ b/src/util/nextcloud.h @@ -22,7 +22,7 @@ const std::string NEXTCLOUD_CONFIG_PATH = NEXTCLOUD_PATH + "/nextcloud.cfg"; const std::string NEXTCLOUD_FILE_PATH = "/mnt/ext1/nextcloud"; const std::string NEXTCLOUD_ROOT_PATH = "/remote.php/dav/files/"; const std::string NEXTCLOUD_STRUCTURE_EXTENSION = ".structure"; -const std::string NEXTCLOUD_END_PATH = "/nextcloud"; +const std::string NEXTCLOUD_START_PATH = "/remote.php/"; class Nextcloud {