Skip to content

Sidecar macro fixes #403

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion tagstudio/src/core/library.py
Original file line number Diff line number Diff line change
Expand Up @@ -2051,7 +2051,7 @@ def add_generic_data_to_entry(self, data, entry_id: int):
# elif meta_tags_field_indices:
# priority_field_index = meta_tags_field_indices[0]

if priority_field_index > 0:
if priority_field_index >= 0:
self.update_entry_field(
entry_id, priority_field_index, [matching[0]], "append"
)
Expand Down
2 changes: 1 addition & 1 deletion tagstudio/src/core/ts_core.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ def get_gdl_sidecar(self, filepath: str | Path, source: str = "") -> dict:
json_dump = {}
info = {}
_filepath: Path = Path(filepath)
_filepath = _filepath.parent / (_filepath.stem + ".json")
_filepath = _filepath.parent / (_filepath.name + ".json")

# NOTE: This fixes an unknown (recent?) bug in Gallery-DL where Instagram sidecar
# files may be downloaded with indices starting at 1 rather than 0, unlike the posts.
Expand Down
2 changes: 1 addition & 1 deletion tagstudio/src/qt/ts_qt.py
Original file line number Diff line number Diff line change
Expand Up @@ -947,7 +947,7 @@ def run_macro(self, name: str, entry_id: int):
"""Runs a specific Macro on an Entry given a Macro name."""
entry = self.lib.get_entry(entry_id)
path = self.lib.library_dir / entry.path / entry.filename
source = entry.path.parts[0]
source = "" if entry.path == Path(".") else entry.path.parts[0].lower()
if name == "sidecar":
self.lib.add_generic_data_to_entry(
self.core.get_gdl_sidecar(path, source), entry_id
Expand Down