Feed is titled "all articles" if only one list of articles is found

Bug #1257959 reported by TomasHnyk
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
calibre
Won't Fix
Undecided
Unassigned

Bug Description

When creating a recipe, If the output of parse_index is

 ('feed title1',[list of articles1]),

 the resulting structure of the ebook created is

 Title of the recipe
 ----All Articles
 ---------First article from the list
 ---------Second article from the list
 ---------etc

 If the output is

 ('feed title1',[list of articles1]),('feed title2',[list of articles2]),

 the resulting structure is:
 Title of the recipe
 ----feed title1
 ---------First article from the list
 ---------Second article from the list
 ---------etc
 ----feed title2
 ---------First article from the list
 ---------Second article from the list
 ---------etc

 (the difference is that in the first case, 'feed title1' is not used and instead generic 'all articles' is used).

 Is this intentional? If so, why? In my recipe, the feed title changes, so I would like to have it.

Reported (by myself) here: http://www.mobileread.com/forums/showthread.php?t=228140 and here http://www.mobileread.com/forums/showpost.php?p=2541730&postcount=5 (so I am not the only one noticing this).

Revision history for this message
Kovid Goyal (kovid) wrote : Re: calibre bug 1257959

I see absolutely no point in having different feed titles on different
downloads. SImply put the extra information into the title, using
self.timefmt, where it will be a lot more useful and easily accessible.

 status wontfix

Changed in calibre:
status: New → Won't Fix
Revision history for this message
TomasHnyk (sup) wrote :

The point is that the feed has different sections (like "home politics" "sport" "op-ed" etc) that do not always got updated. So replacing "all articles" with say "home politics" indicates that only "home politics" were updated. When "home politics" and "sport" were updated but not "op-eds", that is exactly what calibre is doing right now.

Right now, having "all articles" level just seems pointless as it adds no information and only unnecessarily makes the ebook more complex (and the user has to click one more time when reading this).

Of course I could for every article replace its "article_title" with "feed title" + " - " + "article_title" but this would be ugly and would feel a lot like hacking around calibre.

Revision history for this message
Kovid Goyal (kovid) wrote :

So split up your feed into updated and non updated feeds by overriding
parse_feeds()

Revision history for this message
TomasHnyk (sup) wrote :

I am only downloading new items (as per http://www.mobileread.com/forums/showpost.php?p=1295505&postcount=10 ) (and using parse_index).

Arguably, this is a scenario when my request makes the most sense, but if my greping over calibre source works, this happens for mobi in https://github.com/kovidgoyal/calibre/blob/master/src/calibre/ebooks/conversion/plugins/mobi_output.py

on lines 132:139

It used to happen for epub in
https://github.com/kovidgoyal/calibre/blob/master/src/calibre/ebooks/epub/periodical.py
but lines 121:125:

 if False and toc.depth() < 3:
        # Single section periodical
        # Disabled since I prefer the current behavior
        from calibre.ebooks.oeb.base import TOC
        section = TOC(klass='section', title=_('All articles'),

indicate that even you dislike this:-).

Removing this sections altogether would only simplify the code and I do not see what feature would go missing.

Revision history for this message
Kovid Goyal (kovid) wrote :

You were originally asking for a way to change the feed title for single section periodicals.
You are now apparently asking to change the structure of single section downloads.

The MOBI periodical format *requires* the periodical to be organized into sections and articles.

The EPUB output has no peridiocal format and if the recipe has only one feed, those entries are placed at the top level, so there is no feed title to alter.

Therefore, there is no way to do what you are asking now. And as for you original request of changing the title of the single feed (in MOBI), that is do-able, but largely pointless, since that information is better placed in the book title anyway, as I told you three repies ago.

Revision history for this message
TomasHnyk (sup) wrote :

What I am asking is that the obligatory section name in one-section-mobi-periodicals be taken from feed title as given by parse_index or parse_feed. The use case (as I stated above) is when the feed title is not constant for given recipe because sometime only one feed is updated. So the user (presumably) is interested in the name of the feed updated. The information could go to book or article title, but section title seems (to me) to be the most logical place - especially when generic "all articles" adds no info but still has to be there.

i.e. assuming ans is returned by parse_index, I could do something like
if len(ans) = 1:
    self.title = self.title + ' - ' + ans[0][0]
but why if ans[0][0] could go instead of "all articles" for mobi periodicals.

As per use case when the feed title stays the same, no much changes. Instead of "Book title">"All articles">"Article title", you get "Book title">"Feed title">"Article title". Book title and feed title could be the same, but I do not see a problem with that.

Note that this is mobi specific, for other formats, this makes no sense.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.