#14 adapt replace of pre path to other starts

pull/23/head
JuanJakobo 2021-07-06 19:47:53 +02:00
parent c529b6394a
commit 988b8099a5
2 changed files with 9 additions and 3 deletions

View File

@ -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;

View File

@ -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
{