diora-web/docs/sources.md

2.6 KiB

Abos & Quellen (navigation phase 2)

One place to manage every subscription: podcasts, YouTube channels, audiobooks, news sources and blogs. The everyday views (Strom, Merkliste, Wiedergabeliste — docs/podcasts.md —, Nachrichten, Blogs, Hörbücher) show content; adding, changing and removing sources happens here (their own small entry points lead here).

Where

DioraNav section sources ("Abos & Quellen", icon ⚙), panel #tab-sources, group: 'more', footer: true:

  • not in groups() (no tab of its own on a phone);
  • in sections() with footer: true: the sidebar puts it at the bottom, above "Menü"; the phone's app menu has an entry; diora Reader's bar leaves it out;
  • the web page's bar: at the end (wide), as ⚙ (narrow).

The page (static/js/sources.js, diora-web, every platform)

  • Hinzufügen: one field for an address or search words.
    • a YouTube address → its channel (/podcasts/search/?q=), as Podcast or Hörbuch;
    • another address → /feeds/discover/: every feed found, with the kind it looks like (suggested_kind: podcast when most entries carry sound or video, else news/blog) and whether it's subscribed already (subscribed as a feed, podcast_subscribed); the kind can be changed: Podcast · Hörbuch · Nachrichten · Blog;
    • words → the podcast directory (/podcasts/search/). Podcast/Hörbuch subscribe with POST /podcasts/feeds/add/ (then settings {kind: 'audiobook'}), Nachrichten/Blog with POST /feeds/sources/add/.
  • The list: all sources, filter chips Alle · Podcasts · YouTube · Hörbücher · Nachrichten · Blogs · Probleme (fetching fails), and a search over the names.
  • A source's actions (tapping it): open its content, its settings (the existing editors), change its kind (Podcast ↔ Hörbuch, Nachrichten ↔ Blog), unsubscribe.
  • Import & Export: OPML for podcasts and feeds.

Hooks it uses (each optional: without it, it goes to the section instead)

Hook From Does
__dioraPodcastFeedSettings(feedId) native-podcast.js opens the podcast's settings sheet
__dioraPodcastOpenFeed(feedId) native-podcast.js shows the podcast's episode list (Podcasts section)
__dioraFeedsEdit(sourceId) feeds.js opens the source's editor (Nachrichten/Blogs, manage view)
__dioraFeedsStale() feeds.js its state is old: load again when shown
__dioraAudiobookOpen(feedId) audiobooks.js opens the book

The host calls it uses: podcastState, podcastFeedSettings, podcastRefresh (after subscribing), podcastFeedRemoved (after unsubscribing).