Skip to content

Commit

Permalink
Fix remote media links being reported as missing files
Browse files Browse the repository at this point in the history
  • Loading branch information
abdnh committed Jun 23, 2024
1 parent 4010973 commit 6575b79
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/importers/ankiapp.py
Original file line number Diff line number Diff line change
Expand Up @@ -417,9 +417,11 @@ def _repl_blob_ref(self, match: Match[str]) -> str:
self.media[media_obj.ID] = media_obj
if media_obj and media_obj.filename:
return fname_to_link(media_obj.filename)
self.warnings.append(f"Missing media file: {blob_id}")
# dummy image ref
return f'<img src="{blob_id}.jpg"></img>'
if not (blob_id.startswith("https://") or blob_id.startswith("http://")):
self.warnings.append(f"Missing media file: {blob_id}")
# dummy image ref
return f'<img src="{blob_id}.jpg"></img>'
return match.group(0)

def do_import(self) -> int:
self._import_decks()
Expand Down

0 comments on commit 6575b79

Please sign in to comment.