Skip to content

cli: template getters #18

Description

@andykais

we often have to import media in this general manner:

for media_folder in folder:
  info = read(media + '/info.json')
  forager.create(media_folder + '/media.mp4', info, info.tags)

we can attempt to handle simple control structures inside of the forager cli, much like how ffmpeg handles this:

#!/bin/bash


# ifunny:
forager \
  --database ~/.local/share/forager.db \
  'ifunny/%04d/media.*' \
  --json 'info=(__media_folder__)/media_info.json' \
  --title '(info.title)' \
  --description '(info.description)' \
  --source-created-at '(info.timestamp * 1000)' \
  --tag 'source:ifunny'
  --tag 'ifunny:(info.tags)' \
  --tag 'username:(info.username)' \

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