Class: SabnzbdPlusApi::UnannouncedComplete
- Inherits:
-
Object
- Object
- SabnzbdPlusApi::UnannouncedComplete
- Defined in:
- lib/sabnzbd_plus/api/unannounced_complete.rb
Overview
Get all of the slots which are in history and that have not yet been announced
Instance Method Summary (collapse)
-
- (UnannouncedComplete) initialize(mapper = SabnzbdPlusModel::Mapper.new)
constructor
Load the mapper, empty the list of announced nzo ids.
-
- (Array<HistorySlot>) process
Get all of the slots which are in history and that have not yet been announced.
Constructor Details
- (UnannouncedComplete) initialize(mapper = SabnzbdPlusModel::Mapper.new)
Load the mapper, empty the list of announced nzo ids
14 15 16 17 |
# File 'lib/sabnzbd_plus/api/unannounced_complete.rb', line 14 def initialize(mapper = SabnzbdPlusModel::Mapper.new) @announced_nzos = [] @mapper = mapper end |
Instance Method Details
- (Array<HistorySlot>) process
Get all of the slots which are in history and that have not yet been announced
25 26 27 28 29 30 31 32 33 34 35 36 37 |
# File 'lib/sabnzbd_plus/api/unannounced_complete.rb', line 25 def process return_array = [] history = @mapper.history history.slots.each { |slot| unless @announced_nzos.include? slot.nzo_id return_array = return_array << slot @announced_nzos = @announced_nzos << slot.nzo_id end } return return_array end |