Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

xbmc-sql

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

xbmc-sql

  • 0.0.2
  • Rubygems
  • Socket score

Version published
Maintainers
1
Created
Source

Build Status Coveralls branchCode Climate

xbmc_sql

xbmc_sql is a Rails engine for interacting with the XBMC/Kodi database directly. It can also update .nfo files as it makes changes to the database.

Special thanks to Rocketmade for development resources.

Requirements/Support

  • Rails
    • Supported:
      • 4.0
      • 4.1
      • 4.2
  • XBMC 13 (Gotham) or Kodi 14 (Helix)
  • sqlite or mysql database reachable by the Rails application

Setup

Database

In your database.yml, set up an xbmc_development (or whatever environment) seperate than the other database:

development:
   adapter: mysql2
   database: some_other_database
   username: boring_stuff
   password: foo

xbmc_development:
  adapter: mysql2
  database: xbmc
  username: xbmc_user
  password: xbmc_pass
Configuration
XbmcSql.setup do |x|
  # Write .nfo files when matching db record is updated
  x.write_nfo_files = true # Defaults to false

  # Setup a path mapping
  #
  # This is useful if you use have the movies mounted in share
  # By default there are no mappings mapped
  x.path_mappings = {
    'smb://my_nas/' => '/Volumes/Video'
  }
end

Usage

Movies
movie = XbmcSql::Movie.first
movie.title # -> "Seven Samurai"
movie.genre # -> "Action / Drama"

movie.genre = "Action / Drama / History"
movie.save!
# At this point, the movie is updated in the database.
# If write .nfo files are on, the .nfo file would also be updated
Sets
set = XbmcSql::Set.first
set.name # -> "AK100"
set.movies.map { |movie| movie.name } # -> ["Seven Samurai", "Yojimbo",... ]
Built-in tools

There are a couple of useful rake tasks:

# Update the imdb top 250 status of all movies:
rake xbmc_sql:update:top_250

# Update the imdb rating for all movies:
rake xbmc_sql:update:ratings

License

MIT

FAQs

Package last updated on 28 Jan 2015

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc