getnikola / plugins

Extra plugins for Nikola
https://plugins.getnikola.com/
MIT License
56 stars 92 forks source link

Podcast RSS Feed Generator Plugin #419

Closed x1101 closed 3 months ago

x1101 commented 1 year ago

First, I know already that this doesn't work. But I wanted to get what code I have up and then start some discussions on how to fix my errors.

The goal of this is to replace my existing rss_ogg plugin with something that's generic for any audio format, and any number of them. As such, its a TaskMultiplier plugin, not a Task plugin.

I used my initial rss_ogg plugin as a base, and then compared it to the gzip plugin to sort out how to do the task multiplication.

In its current state, when I run nikola list (from a demo site, with only the plugin needed changes made to conf.py) I get pages of this error.

I know I have (at least) two distinct issues going on here with the code, and I'm sure its based on me not fully understanding something or other.

Firstly, this error seems to indicate that despite trying to register all the various paths with site.register_path_handler(), they don't seem to be found

WARNING: Nikola: Unknown path request of kind: rss_mp3
WARNING: Nikola: Unknown path request of kind: rss_mp3
WARNING: Nikola: Unknown path request of kind: rss_ogg
WARNING: Nikola: Unknown path request of kind: rss_ogg

Second, it seems like the process() method on this is being called considerably more often than I'd expected, which I believe is the culprit behind eventually getting this error

 ERROR: Nikola: doit.exceptions.InvalidTask: Task generation 'post_render' has duplicated definition of 'post_render_podcast_rss:sitemap'

What I think I'm missing/misunderstanding is 1) how to correctly register a variable number of paths, constructed from those variables 2) where in the processing this plugin is being invoked, and how to limit that to where it needs to be (at the point where RSS feeds would normally be generated)