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

Episodes in a series and mediaTitle #5

Open
angelamancini opened this issue Jan 20, 2025 · 2 comments
Open

Episodes in a series and mediaTitle #5

angelamancini opened this issue Jan 20, 2025 · 2 comments

Comments

@angelamancini
Copy link

Hi, thanks for making this app. It solves a lot of my problems trying to get my watched media into Trakt.

I have noticed that mediaTitle often shows an episode title and not the series. I know many apps don't give much metadata, but is there a way to dump out all the values of MediaMetadata? I've tinkered a little, but kotlin and android are new to me.

Thanks

@cbeyls
Copy link
Owner

cbeyls commented Jan 21, 2025

Unfortunately, many apps don't provide detailed metadata about the content they are playing.

One way to dump the data is to modify the toMediaTitle() extension method in PlayerConverters.kt to something like this:

fun MediaMetadata?.toMediaTitle(): String {
    if (this == null) {
        return ""
    }

    return keySet().joinToString { key -> "key: $key value: ${getString(key)}" }
}

This will replace the title with a list of all populated keys and values in MediaMetadata, so you can see if the series title is in there. Since there is no standard way to provide this information, different apps may use different keys, or not provide the info at all.

If you find the data you need, I can help you to fine-tune the code to your needs or add a feature to make that data available.

@cbeyls
Copy link
Owner

cbeyls commented Jan 21, 2025

For the record, the app uses METADATA_KEY_DISPLAY_TITLE if available for the title, otherwise it uses METADATA_KEY_TITLE and combines it with METADATA_KEY_ARTIST if also available. Ideally an app would send the series title as METADATA_KEY_ARTIST and the episode title as METADATA_KEY_TITLE and it would as-is, but I assume not many apps do that.

Other keys that could potentially be used to provide a series name are METADATA_KEY_ALBUM, METADATA_KEY_COMPILATION, METADATA_KEY_DISPLAY_SUBTITLE.

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