mProjectsCode / obsidian-media-db-plugin

A plugin that can query multiple APIs for movies, series, anime, games, music and wiki articles, and import them into your vault.
GNU General Public License v3.0
243 stars 28 forks source link

Add index operator for arrays when templating #127

Closed kelszo closed 7 months ago

kelszo commented 7 months ago

Is your feature request related to a problem? Please describe. The author, director, artists, and etc fields can have more than 1 item. But when deciding on a file name, usually one only wants to use the first item. For example: some books include the translators, preface authors, and etc in the author field.

Example from openlibrary: https://openlibrary.org/works/OL21095839W/Doctor_Glas

Describe the solution you'd like Add support for {{ FIRST:variable_name }} and {{ LAST:variable_name }} for indexing arrays.

kelszo commented 7 months ago

I can create a PR if you agree that this is a good addition

mProjectsCode commented 7 months ago

Sounds good :)