Class: ItunesController::RemoveDeadFilesCommand

Inherits:
ServerCommand show all
Defined in:
lib/itunesController/controllserver.rb

Overview

This command will remove any files in the itunes library where the path points at a file that does not exist.

Instance Attribute Summary

Attributes inherited from ServerCommand

#name, #requiredLoginState, #singleThreaded

Instance Method Summary collapse

Methods inherited from ServerCommand

#processLine

Constructor Details

#initialize(state, itunes) ⇒ RemoveDeadFilesCommand

The constructor

Parameters:



364
365
366
# File 'lib/itunesController/controllserver.rb', line 364

def initialize(state,itunes)
    super(ItunesController::CommandName::REMOVEDEADFILES,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

Parameters:



376
377
378
379
# File 'lib/itunesController/controllserver.rb', line 376

def executeSingleThreaded(state)
    @itunes.cacheTracks()
    @itunes.removeDeadTracks()
end

#processData(line, io) ⇒ Object



368
369
370
371
# File 'lib/itunesController/controllserver.rb', line 368

def processData(line,io)
    
    return true, "220 ok\r\n"
end