-
-
Save Coopeh/f5737bfbfbcdc1207a7c854b38cb95be to your computer and use it in GitHub Desktop.
Moved a folder? Clean your sickbeard library... Updated to work with imdb_id instead of tvdb_id
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'rubygems' | |
require 'sequel' | |
database = Sequel.connect('sqlite://sickbeard.db') | |
database[:tv_episodes].select(:location, :episode_id).exclude(:location => "").each do |show| | |
if !File.file?(show[:location]) | |
database[:tv_episodes].filter(:episode_id => show[:episode_id]).delete | |
end | |
end | |
database[:tv_shows].select(:show_name, :imdb_id, :location).each do |show| | |
if !File.directory?(show[:location]) | |
puts "#{show[:show_name]} - #{show[:imdb_id]}" | |
database[:tv_episodes].filter(:showid => show[:imdb_id]).delete | |
database[:tv_shows].filter(:imdb_id => show[:imdb_id]).delete | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment