Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sort order of categories #133

Open
JF-SR opened this issue Nov 15, 2024 · 1 comment
Open

Sort order of categories #133

JF-SR opened this issue Nov 15, 2024 · 1 comment

Comments

@JF-SR
Copy link

JF-SR commented Nov 15, 2024

Hi,
Is there a specific logic for the sorting order when a podcast has multiple categories?
For example, the rss feed for "P3 Krim" https://api.sr.se/api/rss/pod/itunes/34482 has "True Crime" as the first category named (id in podcastindex database: 3500196).

My assumption is that this should be treated as the "main" category and show up as category1. However, the database returns "news" as category1.

Looking at other podcasts it does not seem to be the case that the categories are in alphabetical order, though it does appear that when a main category is chosen and a sub-category specified that the sub-category comes immediately after, for example category1 = "arts", category 2="performing".

Is there any documentation around the sort order for categories in the ten category columns? If there is no specific logic applied to the sorting today (apart from subcategories appear directly after their parent category) could a logic be applied that the first category named in the rss feed always be treated as category 1?

Great service, by the way!
/Jon

@stevencrader
Copy link
Collaborator

I think the categories are shown in order by the Podcast Index category ID. The iTunes categories are flattened when stored in the index.

For this feed, the categories are

"categories": {
    "55": "News",
    "54": "Commentary",
    "103": "True Crime"
},

All the categories can be found using the API request https://api.podcastindex.org/api/1.0/categories/list?pretty. You will need an API account though. See https://api.podcastindex.org/ for an API login.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants