Do not download again a shared book if is already in the journal
This patch chnge the order of checks, to know if the file is in the journal,
or if is shared, or if is a new instance. Before the first check was if the
file was shared, then even when a file was in the Journal,
tried to download it again.
Gonzalo Odiard
9 years ago
360 | 360 | |
361 | 361 | self._progress_alert = None |
362 | 362 | |
363 | if self.shared_activity: | |
363 | if self._jobject.file_path is not None and \ | |
364 | self._jobject.file_path != '': | |
365 | self.read_file(self._jobject.file_path) | |
366 | elif handle.uri: | |
367 | self._load_document(handle.uri) | |
368 | # TODO: we need trasfer the metadata and uodate | |
369 | # bookmarks and urls | |
370 | ||
371 | elif self.shared_activity: | |
364 | 372 | # We're joining |
365 | 373 | if self.get_shared(): |
366 | 374 | # Already joined for some reason, just get the document |
374 | 382 | # Wait for a successful join before trying to get the document |
375 | 383 | self.connect("joined", self._joined_cb) |
376 | 384 | else: |
377 | if self._jobject.file_path is not None and \ | |
378 | self._jobject.file_path != '': | |
379 | self.read_file(self._jobject.file_path) | |
380 | elif handle.uri: | |
381 | self._load_document(handle.uri) | |
382 | # TODO: we need trasfer the metadata and uodate | |
383 | # bookmarks and urls | |
384 | else: | |
385 | # Not joining, not resuming or resuming session without file | |
386 | emptypanel.show(self, 'activity-read', | |
387 | _('No book'), _('Choose something to read'), | |
388 | self._show_journal_object_picker_cb) | |
385 | # Not joining, not resuming or resuming session without file | |
386 | emptypanel.show(self, 'activity-read', | |
387 | _('No book'), _('Choose something to read'), | |
388 | self._show_journal_object_picker_cb) | |
389 | 389 | |
390 | 390 | def _create_back_button(self): |
391 | 391 | back = ToolButton('go-previous-paired') |