Skip to content

Populate item.meta in the resolvers so {postId} and {username} work #48

Description

@jamditis

#47 landed the filename template engine. {platform}, {type}, {index} and {date} work today. {postId} and {username} render as nothing, because no resolver populates item.meta yet.

The renderer absorbs a missing token along with its separator, so a template naming them degrades to a shorter name rather than a broken one — but two of six advertised tokens being permanently empty is not a finished feature.

Contract

Resolvers attach the structured parts alongside the name they already build:

items.push({
  url,
  type: 'image',
  filename: id ? `photo_${id}_${index}` : null,  // unchanged, still the default
  meta: { postId: id, username },
});

filename stays as-is. It is what an unconfigured user gets, and #47 keeps templates opt-in precisely so an update does not rename anyone's files.

Platforms

  • facebook.jsdo this one after Stop the Facebook album walk from emitting one photo twice #45 merges. It rewrites the same item-construction lines, so doing both at once conflicts.
  • instagram.js — has shortcode in scope.
  • twitter.js — has tweetId.
  • linkedin.js — has the post id.
  • tiktok.js — has videoId.
  • bluesky.js — check what it exposes.

username is only available where the resolver can read it from the DOM or the API response. Leave it unset where it cannot rather than guessing: a wrong username in a filename is worse than a missing one.

Do not set postId on the facebook capture fallback. That store is page-wide and those URLs were not read from the post's own DOM, so an id extracted from one is not reliably this post's.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions