mProjectsCode/obsidian-media-db-plugin

Impossible to generate entries that have a colon in the title

natdennett opened this issue · 1 comments

  • The Plugin is up to date
  • Obsidian is up to date

Describe the bug
If you try to generate a note from any item of media that includes a colon symbol : in the title, the plugin will generate a blank preview and the OK button is hidden, so you can't create the note.

My hope is that this is a simple typo somewhere in the code!

To Reproduce
Steps to reproduce the behavior:

  1. Call up the "Media DB Search" dialog from the command palate or a hotkey
  2. Search for "The Lord of the Rings: The Fellowship of the Ring", or "Spider-Man: Into the Spiderverse", or "The Case of the Golden Idol: The Lemurian Vampire"
  3. Select the correct option.
  4. See error

Expected behavior
I'd expect to see the template note appear, and have

Screenshots
This is what I'm accustomed to seeing:
Screenshot 2023-11-05 at 08 39 51

Instead, here's what I see if I pick anything with a colon in the title:
Screenshot 2023-11-05 at 08 40 45

I've tried looking up the record by OMDB id instead, but the problem persists nonetheless. For example, the ID for Into the Spider-Verse is tt4633694. If I pick "Create Media DB entry by id," I still am greeted by the same blank screen.
Screenshot 2023-11-05 at 08 43 22

Occurs on

  • Windows
  • macOS
  • Linux
  • Android
  • iOS

Plugin version
0.5.2

Additional context

Here's the text of the relevant template file that I use for generating movie entries:

---
type: {{type}}
title: "{{title}}"
english_title: {{englishTitle}}
year: {{year}}
genres: {{genres}}
actors: {{actors}}
image: {{image}}
duration: {{duration}}
producer: {{producer}}
release_date: {{premiere}}
is_completed: false
shelf: done
---

![image|200]({{image}})

I realized the issue lied in my template file: the format of the title parameter needed to be:

title: 
  "{ title }":