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
250 stars 30 forks source link

Metadata template capabilities #88

Closed SalahAdDin closed 1 year ago

SalahAdDin commented 1 year ago

Is your feature request related to a problem? Please describe. We would like to add some extra metadata like playing(played, unplayed, playing) or modify the existing one, so we can filter media on data views.

We tried to do this by templating also the metadata, but it didn't work.

Describe the solution you'd like Enabling templating also the metadata as book search already does.

Additional context Add any other context or screenshots about the feature request here.

ltctceplrm commented 1 year ago

I'm not sure why it doesn't work for you but by any chance do you use the default template plugin or templater? I use templater and it works for me.

In the plugin settings I turned I turned off the "played" field in the games section and instead added a new field in the template that I called "status" with the following options: started, ongoing, finished, on hold, dropped. That way I can reuse my dataviews between series, books or games.

Here's an example of my template:

---
title: <% tp.file.title %>
created: <% tp.date.now("YYYY-MM-DD[T]HH:mm:ssZ") %>
tags: videogame_notes mediaDB/game
status: ""
startDate: ""
finishDate: ""
playtime: ""
personalRating: ""
comments: ""
---# {{title}}
![poster_<% tp.frontmatter.type %>_<% tp.file.title %>|350](<% tp.frontmatter.image %>)

# Notes:
SalahAdDin commented 1 year ago

I'm not sure why it doesn't work for you but by any chance do you use the default template plugin or templater? I use templater and it works for me.

In the plugin settings I turned I turned off the "played" field in the games section and instead added a new field in the template that I called "status" with the following options: started, ongoing, finished, on hold, dropped. That way I can reuse my dataviews between series, books or games.

Here's an example of my template:

---
title: <% tp.file.title %>
created: <% tp.date.now("YYYY-MM-DD[T]HH:mm:ssZ") %>
tags: videogame_notes mediaDB/game
status: ""
startDate: ""
finishDate: ""
playtime: ""
personalRating: ""
comments: ""
---# {{title}}
![poster_<% tp.frontmatter.type %>_<% tp.file.title %>|350](<% tp.frontmatter.image %>)

# Notes:

I'm using the default template plugin, and it is not able to change the metadata.

ltctceplrm commented 1 year ago

If you try it with templater I'm pretty sure it will work

mProjectsCode commented 1 year ago

Seems doable with templater, so I will close this issue.

SalahAdDin commented 1 year ago

Seems doable with templater, so I will close this issue.

how did you do that?