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
- 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|
x.write_nfo_files = true
x.path_mappings = {
'smb://my_nas/' => '/Volumes/Video'
}
end
Usage
Movies
movie = XbmcSql::Movie.first
movie.title
movie.genre
movie.genre = "Action / Drama / History"
movie.save!
Sets
set = XbmcSql::Set.first
set.name
set.movies.map { |movie| movie.name }
Built-in tools
There are a couple of useful rake tasks:
rake xbmc_sql:update:top_250
rake xbmc_sql:update:ratings
License
MIT