mirror of
https://github.com/johannesjo/super-productivity.git
synced 2026-01-22 18:30:09 +00:00
fix(sync): error in xml parser
This commit is contained in:
parent
1689b6c34b
commit
3ced51b168
1 changed files with 12 additions and 6 deletions
|
|
@ -171,13 +171,19 @@ export class WebdavXmlParser {
|
|||
|
||||
const decodedHref = decodeURIComponent(href);
|
||||
|
||||
// Skip the base path itself (we only want children)
|
||||
// Normalize both paths: remove leading/trailing slashes for comparison
|
||||
const normalizedHref = decodedHref.replace(/^\//, '').replace(/\/$/, '');
|
||||
const normalizedBasePath = basePath.replace(/^\//, '').replace(/\/$/, '');
|
||||
// For single file queries (when we're looking for a specific file),
|
||||
// we should NOT skip the base path itself
|
||||
// Only skip if it's a directory listing (ends with /)
|
||||
const isDirectoryListing = basePath.endsWith('/');
|
||||
if (isDirectoryListing) {
|
||||
// Skip the base path itself (we only want children)
|
||||
// Normalize both paths: remove leading/trailing slashes for comparison
|
||||
const normalizedHref = decodedHref.replace(/^\//, '').replace(/\/$/, '');
|
||||
const normalizedBasePath = basePath.replace(/^\//, '').replace(/\/$/, '');
|
||||
|
||||
if (normalizedHref === normalizedBasePath) {
|
||||
continue;
|
||||
if (normalizedHref === normalizedBasePath) {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
const fileMeta = this.parseXmlResponseElement(response, decodedHref);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue