mirror of
https://github.com/natelandau/obsidian-metadata.git
synced 2025-11-17 09:23:40 -05:00
refactor: remove unused code
This commit is contained in:
@@ -572,7 +572,7 @@ class Vault:
|
|||||||
for _note in self.all_notes:
|
for _note in self.all_notes:
|
||||||
path = _note.note_path.relative_to(self.vault_path)
|
path = _note.note_path.relative_to(self.vault_path)
|
||||||
if str(path) in dictionary:
|
if str(path) in dictionary:
|
||||||
log.info(f"Updating metadata for '{path}'")
|
log.debug(f"Bulk update metadata for '{path}'")
|
||||||
num_changed += 1
|
num_changed += 1
|
||||||
_note.delete_all_metadata()
|
_note.delete_all_metadata()
|
||||||
for row in dictionary[str(path)]:
|
for row in dictionary[str(path)]:
|
||||||
@@ -589,7 +589,7 @@ class Vault:
|
|||||||
location=self.insert_location,
|
location=self.insert_location,
|
||||||
)
|
)
|
||||||
|
|
||||||
if row["type"].lower() == "tag" or row["type"].lower() == "tags":
|
if row["type"].lower() == "tag":
|
||||||
_note.add_metadata(
|
_note.add_metadata(
|
||||||
area=MetadataType.TAGS,
|
area=MetadataType.TAGS,
|
||||||
value=row["value"],
|
value=row["value"],
|
||||||
|
|||||||
@@ -766,7 +766,7 @@ def test_update_from_dict_3(test_vault):
|
|||||||
"test1.md": [
|
"test1.md": [
|
||||||
{"type": "frontmatter", "key": "new_key", "value": "new_value"},
|
{"type": "frontmatter", "key": "new_key", "value": "new_value"},
|
||||||
{"type": "inline_metadata", "key": "new_key2", "value": "new_value"},
|
{"type": "inline_metadata", "key": "new_key2", "value": "new_value"},
|
||||||
{"type": "tags", "key": "", "value": "new_tag"},
|
{"type": "tag", "key": "", "value": "new_tag"},
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
assert vault.update_from_dict(update_dict) == 1
|
assert vault.update_from_dict(update_dict) == 1
|
||||||
|
|||||||
Reference in New Issue
Block a user