'Add Recently Added to the basic NCX file.
Generate the Recently Added NCX content, add to self.ncx_soup.
Inputs:
books_by_date_range (list)
Updated:
play_order (int)
Outputs:
ncx_soup (file): updated'

def generate_ncx_by_date_added(self, tocTitle):

    self.update_progress_full_step(_('NCX    for    Recently    Added'))
    def _add_to_master_month_list(current_titles_list):
        book_count = len(current_titles_list)
        current_titles_list = '    &bull;    '.join(current_titles_list)
        current_titles_list = self.format_ncx_text(current_titles_list, dest='description')
        master_month_list.append((current_titles_list, current_date, book_count))
    def _add_to_master_date_range_list(current_titles_list):
        book_count = len(current_titles_list)
        current_titles_list = '    &bull;    '.join(current_titles_list)
        current_titles_list = self.format_ncx_text(current_titles_list, dest='description')
        master_date_range_list.append((current_titles_list, date_range, book_count))
    ncx_soup = self.ncx_soup
    HTML_file = 'content/ByDateAdded.html'
    if self.generate_for_kindle_mobi:
        body = ncx_soup.find('navPoint')
    else:
        body = ncx_soup.find('navMap')
    btc = len(body.contents)
    navPointTag = Tag(ncx_soup, 'navPoint')
    if self.generate_for_kindle_mobi:
        navPointTag['class'] = 'section'
    file_ID = ('%s' % tocTitle.lower())
    file_ID = file_ID.replace('    ', '')
    navPointTag['id'] = ('%s-ID' % file_ID)
    navPointTag['playOrder'] = self.play_order
    self.play_order += 1
    navLabelTag = Tag(ncx_soup, 'navLabel')
    textTag = Tag(ncx_soup, 'text')
    textTag.insert(0, NavigableString(('%s' % tocTitle)))
    navLabelTag.insert(0, textTag)
    nptc = 0
    navPointTag.insert(nptc, navLabelTag)
    nptc += 1
    contentTag = Tag(ncx_soup, 'content')
    contentTag['src'] = ('%s#section_start' % HTML_file)
    navPointTag.insert(nptc, contentTag)
    nptc += 1
    current_titles_list = []
    master_date_range_list = []
    today = datetime.datetime.now()
    today_time = datetime.datetime(today.year, today.month, today.day)
    for (i, date) in enumerate(self.DATE_RANGE):
        if i:
            date_range = ('%d    to    %d    days    ago' % (self.DATE_RANGE[(i - 1)], self.DATE_RANGE[i]))
        else:
            date_range = ('Last    %d    days' % self.DATE_RANGE[i])
        date_range_limit = self.DATE_RANGE[i]
        for book in self.books_by_date_range:
            book_time = datetime.datetime(book['timestamp'].year, book['timestamp'].month, book['timestamp'].day)
            if ((today_time - book_time).days <= date_range_limit):
                current_titles_list.append(book['title'])
            else:
                break
        if current_titles_list:
            _add_to_master_date_range_list(current_titles_list)
        current_titles_list = [book['title']]
    for books_by_date_range in master_date_range_list:
        navPointByDateRangeTag = Tag(ncx_soup, 'navPoint')
        if self.generate_for_kindle_mobi:
            navPointByDateRangeTag['class'] = 'article'
        navPointByDateRangeTag['id'] = ('%s-ID' % books_by_date_range[1].replace('    ', ''))
        navPointTag['playOrder'] = self.play_order
        self.play_order += 1
        navLabelTag = Tag(ncx_soup, 'navLabel')
        textTag = Tag(ncx_soup, 'text')
        textTag.insert(0, NavigableString(books_by_date_range[1]))
        navLabelTag.insert(0, textTag)
        navPointByDateRangeTag.insert(0, navLabelTag)
        contentTag = Tag(ncx_soup, 'content')
        contentTag['src'] = ('%s#bda_%s' % (HTML_file, books_by_date_range[1].replace('    ', '')))
        navPointByDateRangeTag.insert(1, contentTag)
        if self.generate_for_kindle_mobi:
            cmTag = Tag(ncx_soup, ('%s' % 'calibre:meta'))
            cmTag['name'] = 'description'
            cmTag.insert(0, NavigableString(books_by_date_range[0]))
            navPointByDateRangeTag.insert(2, cmTag)
            cmTag = Tag(ncx_soup, ('%s' % 'calibre:meta'))
            cmTag['name'] = 'author'
            navStr = (('%d    titles' % books_by_date_range[2]) if (books_by_date_range[2] > 1) else ('%d    title' % books_by_date_range[2]))
            cmTag.insert(0, NavigableString(navStr))
            navPointByDateRangeTag.insert(3, cmTag)
        navPointTag.insert(nptc, navPointByDateRangeTag)
        nptc += 1
    current_titles_list = []
    master_month_list = []
    current_date = self.books_by_month[0]['timestamp']
    for book in self.books_by_month:
        if ((book['timestamp'].month != current_date.month) or (book['timestamp'].year != current_date.year)):
            _add_to_master_month_list(current_titles_list)
            current_date = book['timestamp'].date()
            current_titles_list = [book['title']]
        else:
            current_titles_list.append(book['title'])
    _add_to_master_month_list(current_titles_list)
    for books_by_month in master_month_list:
        datestr = strftime(u'%B    %Y', books_by_month[1].timetuple())
        navPointByMonthTag = Tag(ncx_soup, 'navPoint')
        if self.generate_for_kindle_mobi:
            navPointByMonthTag['class'] = 'article'
        navPointByMonthTag['id'] = ('bda_%s-%s-ID' % (books_by_month[1].year, books_by_month[1].month))
        navPointTag['playOrder'] = self.play_order
        self.play_order += 1
        navLabelTag = Tag(ncx_soup, 'navLabel')
        textTag = Tag(ncx_soup, 'text')
        textTag.insert(0, NavigableString(datestr))
        navLabelTag.insert(0, textTag)
        navPointByMonthTag.insert(0, navLabelTag)
        contentTag = Tag(ncx_soup, 'content')
        contentTag['src'] = ('%s#bda_%s-%s' % (HTML_file, books_by_month[1].year, books_by_month[1].month))
        navPointByMonthTag.insert(1, contentTag)
        if self.generate_for_kindle_mobi:
            cmTag = Tag(ncx_soup, ('%s' % 'calibre:meta'))
            cmTag['name'] = 'description'
            cmTag.insert(0, NavigableString(books_by_month[0]))
            navPointByMonthTag.insert(2, cmTag)
            cmTag = Tag(ncx_soup, ('%s' % 'calibre:meta'))
            cmTag['name'] = 'author'
            navStr = (('%d    titles' % books_by_month[2]) if (books_by_month[2] > 1) else ('%d    title' % books_by_month[2]))
            cmTag.insert(0, NavigableString(navStr))
            navPointByMonthTag.insert(3, cmTag)
        navPointTag.insert(nptc, navPointByMonthTag)
        nptc += 1
    body.insert(btc, navPointTag)
    btc += 1
    self.ncx_soup = ncx_soup
