Coder Social home page Coder Social logo

talraash / obsidian-media-db-plugin Goto Github PK

View Code? Open in Web Editor NEW

This project forked from mprojectscode/obsidian-media-db-plugin

0.0 0.0 0.0 480 KB

A plugin that can query multiple APIs for movies, series, anime, games, music and wiki articles, and import them into your vault.

License: GNU General Public License v3.0

JavaScript 1.28% TypeScript 95.52% CSS 1.20% Svelte 2.00%

obsidian-media-db-plugin's Introduction

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.

Features

Search by Title

Search a movie, series, anime, game, music release or wiki article by its name across multiple APIs.

Search by ID

Allows you to search by an ID that varies from API to API. Concrete information on this feature can be found in the description of the individual APIs.

Templates

The plugin allows you to set a template note that gets added to the end of any note created by this plugin.
The plugin also offers simple "template tgs". E.g. if the template includes {{ title }}, it will be replaced by the title of the movie, show or game.
Note that "template tags" are surrounded with two curly braces and that the spaces inside the curly braces are important.

For arrays there are two special ways of displaying them.

  • using {{ LIST:variable_name }} will result in
      - element 1
      - element 2
      - element 3
      - ...
    
  • using {{ ENUM:variable_name }} will result in
      element 1, element 2, element 3, ...
    

Available variables that can be used in template tags are the same variables from the metadata of the note.

I also published my own templates here.

Metadata field customization

Allows you to rename the metadata fields this plugin generates through mappings.

A mapping has to follow this syntax [origional property name] -> [new property name]. Multiple mappings are separated by a new line. So e.g.:

title -> name
year -> releaseYear

Bulk Import

The plugin allows you to import your preexisting media collection and upgrade them to Media DB entries.

Prerequisites

The preexisting media notes must be inside a folder in your vault. For the plugin to be able to query them they need one metadata field that is used as the title the piece of media is searched by. This can be achieved by for example using a csv import plugin to import an existing list from outside of obsidian.

Importing

To start the import process, right-click on the folder and select the Import folder as Media DB entries option. Then specify the API to search, if the current note content and metadata should be appended to the Media DB entry and the name of the metadata field that contains the title of the piece of media.

Then the plugin will go through every file in the folder and prompt you to select from the search results.

Post import

After all files have been imported or the import was canceled, you will find the new entries as well as an error report that contains any errors or skipped/canceled files in the folder specified in the setting of the plugin.

How to install

The plugin is now released, so it can be installed directly through obsidian's plugin installer.

Alternatively, you can manually download the zip archive from the latest release here on GitHub.
After downloading, extract the archive into the .obsidian/plugins folder in your vault.

The folder structure should look like this:

[path to your vault]
|_ .obsidian
   |_ plugins
      |_ obsidian-media-db-plugin
         |_ main.js
         |_ manifest.json
         |_ styles.css

How to use

(pictures are coming)

Once you have installed this plugin, you will find a database icon in the left ribbon.
When using this or the Add new Media DB entry command, a popup will open.
Here you can enter the title of what you want to search for and then select in which APIs to search.

After clicking search, a new popup will open prompting you to select from the search results.
Now you select the result you want and the plugin will cast it's magic and create a new note in your vault, that contains the metadata of the selected search result.

Currently supported media types

  • movies (including specials)
  • series (including OVAs)
  • games
  • music releases
  • wiki articles

Currently supported APIs:

Name Description Supported formats Authentification Rate limiting SFW filter support
Jikan Jikan is an API that uses My Anime List and offers metadata for anime. series, movies, specials, OVAs No 60 per minute and 3 per second Yes
OMDb OMDb is an API that offers metadata for movie, series and games. series, movies, games Yes, you can get a free key here here 1000 per day No
MusicBrainz MusicBrainz is an API that offers information about music releases. music releases No 50 per second No
Wikipedia The Wikipedia API allows access to all Wikipedia articles. wiki articles No None No
Steam The Steam API offers information on all steam games. games No 10000 per day No

Notes

  • Jikan
    • sometimes the api is very slow, this is normal
    • you need to use the title the anime has on My Anime List, which is in most cases the japanese title
      • e.g. instead of "Demon Slayer" you have to search "Kimetsu no Yaiba"

Search by ID

  • Jikan
    • the ID you need is the ID of the anime on My Anime List
    • you can find this ID in the URL
      • e.g. for "Beyond the Boundary" the URL looks like this https://myanimelist.net/anime/18153/Kyoukai_no_Kanata so the ID is 18153
  • OMDb
    • the ID you need is the ID of the movie or show on IMDb
    • you can find this ID in the URL
      • e.g. for "Rogue One" the URL looks like this https://www.imdb.com/title/tt3748528/ so the ID is tt3748528
  • MusicBrainz
    • the id of a release is not easily accessible, you are better off just searching by title
  • Wikipedia
    • here is a guide to finding the Wikipedia ID for an article
  • Steam
    • you can find this ID in the URL
      • e.g. for "Factorio" the URL looks like this https://store.steampowered.com/app/427520/Factorio/ so the ID is 427520

Problems, unexpected behavior or improvement suggestions?

You are more than welcome to open an issue on GitHub.

Changelog

0.5.0

  • New simple search modal, select the media type and search all applicable APIs
  • More data for Board Games
  • Actors and Streaming Platforms for Movies and Series
  • Separate new file location for all media types
  • Separate command for each media type
  • Fix problems with closing of preview modal

0.3.2

  • Added Board Game Geek API (documentation pending)
  • More information in the search results
  • various fixes

0.3.1

  • various fixes

0.3.0

  • Added bulk import. Import a folder of media notes as Media DB entries (thanks to PaperOrb on GitHub for their input and for helping me test this feature)
  • Added a custom result select modal that allows you to select multiple results at once
  • Fixed a bug where the note creation would fail when the metadata included a field with the values null or undefined

0.2.1

  • fixed a small bug with the initial selection of an API in the ID search modal

0.2.0

  • Added the option to rename metadata fields through property mappings
  • fixed note creation falling, when the folder set in the settings did not exist

Contributions

Thank you for wanting to contribute to this project.

Contributions are always welcome. If you have an idea, feel free to open a feature request under the issue tab or even create a pull request.

Credits

Credits go to:

obsidian-media-db-plugin's People

Contributors

mprojectscode avatar ab1908 avatar cedricfinance avatar conumey avatar conorveracity avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.