mirror of
https://github.com/samsonjs/vdirsyncer.git
synced 2026-04-27 14:57:41 +00:00
Don't emit collections twice
This commit is contained in:
parent
a741b5d639
commit
d9c2b7ba35
1 changed files with 6 additions and 1 deletions
|
|
@ -86,10 +86,15 @@ class Discover(object):
|
||||||
# Another one of Radicale's specialties: Discovery is broken (returning
|
# Another one of Radicale's specialties: Discovery is broken (returning
|
||||||
# completely wrong URLs at every stage) as of version 0.9.
|
# completely wrong URLs at every stage) as of version 0.9.
|
||||||
# https://github.com/Kozea/Radicale/issues/196
|
# https://github.com/Kozea/Radicale/issues/196
|
||||||
|
done = set()
|
||||||
for principal in itertools.chain(self._find_principal(), ['']):
|
for principal in itertools.chain(self._find_principal(), ['']):
|
||||||
for home in itertools.chain(self._find_home(principal), ['']):
|
for home in itertools.chain(self._find_home(principal), ['']):
|
||||||
for collection in self._find_collections(home):
|
for collection in self._find_collections(home):
|
||||||
yield collection
|
href = utils.urlparse.urljoin(self.session.url,
|
||||||
|
collection['href'])
|
||||||
|
if href not in done:
|
||||||
|
done.add(href)
|
||||||
|
yield collection
|
||||||
|
|
||||||
def _find_home(self, principal):
|
def _find_home(self, principal):
|
||||||
headers = self.session.get_default_headers()
|
headers = self.session.get_default_headers()
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue