Skip to content

Commit

Permalink
some fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Daem0n committed Apr 19, 2011
1 parent c13adb5 commit c53e8ed
Showing 1 changed file with 13 additions and 9 deletions.
22 changes: 13 additions & 9 deletions lib/transmission-connect/configuration.rb
Expand Up @@ -51,7 +51,8 @@ class Client
# HOST = 'http://127.0.0.1:3000'
HOST = 'http://peerlize.hitlan.ru'
FIELDS = ['downloadDir', 'error', 'errorString', 'eta', 'hashString', 'id', 'name', 'peersConnected', 'peersKnown', 'peersSendingToUs', 'percentDone', 'rateDownload', 'rateUpload', 'recheckProgress', 'startDate', 'status', 'totalSize', 'torrentFile']
attr_reader :interval, :peer_port, :download_dir, :options
attr_reader :interval
attr_accessor :peer_port, :download_dir
def initialize(args)
@host = args.delete(:host) || '127.0.0.1'
@port = args.delete(:port) || 9091
Expand All @@ -62,15 +63,9 @@ def initialize(args)
@down = args.delete(:down) || false
@transmission = Transmission::Client.new(@host, @port, @username, @password)
@transmission.session do |session|
@peer_port = session.peer_port
@download_dir = session.download_dir
self.peer_port = session.peer_port
self.download_dir = session.download_dir
end
@options = {
:port => @peer_port,
:up => up?,
:down => down?,
:download_dir => @download_dir
}
end

def report
Expand Down Expand Up @@ -100,6 +95,15 @@ def down?
@down
end

def options
@options ||= {
:port => peer_port,
:up => up?,
:down => down?,
:download_dir => download_dir
}
end

end

end

0 comments on commit c53e8ed

Please sign in to comment.