Class: ItunesController::RemoveFilesCommand
- Inherits:
-
ServerCommand
- Object
- ServerCommand
- ItunesController::RemoveFilesCommand
- Defined in:
- lib/itunesController/controllserver.rb
Overview
This command is used to remove files registered with the FILE command from the itunes library then clear the file list.
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) ⇒ RemoveFilesCommand
constructor
The constructor.
- #processData(line, io) ⇒ Object
Methods inherited from ServerCommand
Constructor Details
#initialize(state, itunes) ⇒ RemoveFilesCommand
The constructor
337 338 339 |
# File 'lib/itunesController/controllserver.rb', line 337 def initialize(state,itunes) super(ItunesController::CommandName::REMOVEFILES,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
349 350 351 352 353 354 |
# File 'lib/itunesController/controllserver.rb', line 349 def executeSingleThreaded(state) @itunes.cacheTracks() state.files.each do | path | @itunes.removeTrack(path) end end |
#processData(line, io) ⇒ Object
341 342 343 344 |
# File 'lib/itunesController/controllserver.rb', line 341 def processData(line,io) @state.files=[] return true, "220 ok\r\n" end |