I want to extend the menu in one of my plugins that already loads its menu via an OPML file ... which contains a static list of stations.
I want to add some dynamic content which would appear after a user clicks on the new menu item.
I see (for example from BBCiPlayer plugin) that one of the attributes is "parser" but would that parser be called (it would go off and do its own thing) if the "URL" parameter was empty or missing?
If not - then I suppose I could put in a dummy URL that fetches something local but is then ignored.
I can see, from the VirginRadio plugin for example, ways to dynamically generate the entire menu but having already made a 400+ line OPML file I wanted to see if I can avoid having to redo all of that.
Results 1 to 4 of 4
-
2021-02-22, 10:15 #1
- Join Date
- Apr 2005
- Location
- UK/London
- Posts
- 3,634
Using OPML to invoke parser in plugin without URL
Paul Webster
http://dabdig.blogspot.com
Author of "Now Playing" plugins covering Radio France (FIP etc), KCRW, Supla Finland, ABC Australia, CBC/Radio-Canada and RTE Ireland
-
2021-02-22, 10:34 #2
- Join Date
- Oct 2005
- Location
- Ireland
- Posts
- 20,092
You can have a static URL and parser will be called but beware of caching - if LMS see same URL it will use cached result from previous parse so menu result will not be dynamic.
I think another parameter nocache will disable caching if URL (and result) is unchanging.
edit:
An URL which will give a different result everytime - could be a clock.
http://time.akamai.com/?isoLast edited by bpa; 2021-02-22 at 10:40.
-
2021-02-22, 11:25 #3
- Join Date
- Apr 2005
- Location
- UK/London
- Posts
- 3,634
Thanks.
I'll give it a try.Paul Webster
http://dabdig.blogspot.com
Author of "Now Playing" plugins covering Radio France (FIP etc), KCRW, Supla Finland, ABC Australia, CBC/Radio-Canada and RTE Ireland
-
2021-02-22, 13:41 #4
- Join Date
- Apr 2005
- Location
- UK/London
- Posts
- 3,634
I worked through it (in my head) but was struggling to see how I would get my extra data without pausing LMS.
So I think I will switch over to expectingtofly/Stuart's way because that lets me do my own set of async http calls to get my extra data and feed the data back into the menu later via a callback when it is all handled.Paul Webster
http://dabdig.blogspot.com
Author of "Now Playing" plugins covering Radio France (FIP etc), KCRW, Supla Finland, ABC Australia, CBC/Radio-Canada and RTE Ireland