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 · 2 comments
Open

Sort order of categories #133

JF-SR opened this issue Nov 15, 2024 · 2 comments

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.

@JF-SR
Copy link
Author

JF-SR commented Nov 22, 2024

Thanks for the answer. A couple of follow-up questions.

All main iTunes categories with an ampersand in the title e.g. "Health & Fitness" have become two separate categories in podcastindex: "health" and "fitness". I guess the logic there is that ampersands always result in two separate rows.

I also noticed that there are no categories for iTunes categories such as "Film History". Is the logic there that they have been converted into two separate categories "film" and "history" which together become "film history"? So that a podcast that has been tagged "Film History" in iTunes will end up in the same group as podcasts that are tagged with the main "History" tag?

If this is the case then there appears to be an exception for "True Crime".

I'm trying to reverse-engineer back to the iTune categories so understanding the logic would help. It seems to me that splitting categories if they contain a "space" can result in some confusion around what the categories actually represent.

There are other categories that do not appear in iTunes for example "Tabletop" and "Role-Playing". What is the source for these categories?

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