Class: ItunesController::RefreshFilesCommand

Inherits:
ServerCommand show all
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

Methods inherited from ServerCommand

#processLine

Constructor Details

#initialize(state, itunes) ⇒ RefreshFilesCommand

The constructor

Parameters:



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

Parameters:



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