Skip to content

amahi/go-metadata

master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Movie and TV Metadata Library Build Status

We have created a metadata library that helps us retrieve metadata information and artwork about media files. Metadata Flow

Here is a high level picture of how the library works: Metadata Library Architecture

And here is the godoc go-metadata documentation.

Install

go get github.com/amahi/go-metadata

Details

  • In our implementation of this library L, the origin server acts as a client to the library
  • The main entry point to L is method/function call with a media name(string) and Hint(string) such as "tv" or "movie" whose metadata we return in a structured way
  • Format of the metadata returned will be a json structure with details such as cast, director, and url of cover art images that are related to it.
  • The library keeps a transparent cache as part of the implementation
  • Whenever L gets a request from the client, it queries a local database (the cache) to find if the requested information is present in cache already
  • If it is present, L reads the data from cache and returns it
  • Otherwise S will request metadata from an online API, return the results as soon as possible and cache it
  • The cache should uses a LRU caching policy

Metadata Output

Lib,err := metadata.Init(1000000,"metadata.db")
if err == nil {
        data, err := Lib.GetMetadata("Breaking Bad","tv")
        if err == nil {
                fmt.Println(data)
        }
}

The above code will return a json string in the following format:-

{
   "title":"Breaking Bad",
   "artwork":"http://thetvdb.com/banners/posters/81189-22.jpg",
   "year":"2008"
}

About

Media metadata library in Go

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages