Class: ItunesController::RefreshFilesCommand
- Inherits:
-
ServerCommand
- Object
- ServerCommand
- ItunesController::RefreshFilesCommand
- Defined in:
- lib/itunesController/controllserver.rb
Overview
This command is used to refresh files registerd with the FILE command. It tells iTunes to update the meta data from the information stored in the files.
Instance Attribute Summary
Attributes inherited from ServerCommand
#name, #requiredLoginState, #singleThreaded
Instance Method Summary collapse
-
#executeSingleThreaded(state) ⇒ Object
This is executed when the command is popped from the job queue.
-
#initialize(state, itunes) ⇒ RefreshFilesCommand
constructor
The constructor.
- #processData(line, io) ⇒ Object
Methods inherited from ServerCommand
Constructor Details
#initialize(state, itunes) ⇒ RefreshFilesCommand
The constructor
310 311 312 |
# File 'lib/itunesController/controllserver.rb', line 310 def initialize(state,itunes) super(ItunesController::CommandName::REFRESHFILES,ServerState::AUTHED,true,state,itunes) end |
Instance Method Details
#executeSingleThreaded(state) ⇒ Object
This is executed when the command is popped from the job queue. It is used to force single threaded access to itunes
322 323 324 325 326 327 |
# File 'lib/itunesController/controllserver.rb', line 322 def executeSingleThreaded(state) @itunes.cacheTracks() state.files.each do | path | @itunes.updateTrack(path) end end |
#processData(line, io) ⇒ Object
314 315 316 317 |
# File 'lib/itunesController/controllserver.rb', line 314 def processData(line,io) @state.files=[] return true, "220 ok\r\n" end |