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

Title not being recognized when playing from stream #146

Open
BlessedLongsword opened this issue Feb 13, 2025 · 1 comment
Open

Title not being recognized when playing from stream #146

BlessedLongsword opened this issue Feb 13, 2025 · 1 comment

Comments

@BlessedLongsword
Copy link

Hello, first of all I'd like to thank you for your work in this project, I was really looking for a tool like this and I was almost able to set it up for my use case.

I use a media server (jellyfin) to watch anime, and I use a tool to stream to mpv, which is using mpv-mpris. If I try to use Tundra while watching the stream, it will fail with these logs:

2025-02-13 00:46:52 [INFO] [tundra::app] Found an active player: mpv, playing stream?static=true&MediaSourceId=54a41b9d586dfe007fc420d04afcd57c&api key=279cebfd1a59448da25f25b920dc20cd season 1 episode 1
2025-02-13 00:46:52 [ERROR] [tundra::gtk_gui] Could not communicate with MAL: HTTP status client error (400 Bad Request) for url (https://api.myanimelist.net/v2/anime?q=stream%3Fstatic%3Dtrue%26MediaSourceId%3D54a41b9d586dfe007fc420d04afcd57c%26api+key%3D279cebfd1a59448da25f25b920dc20cd&fields=title%2Cmain_picture%2Calternative_titles%2Cnum_episodes%2Cmy_list_status%2Cmedia_type%2Cpopularity)
2025-02-13 00:46:52 [ERROR] [tundra::gtk_gui] HTTP status client error (400 Bad Request) for url (https://api.myanimelist.net/v2/anime?q=stream%3Fstatic%3Dtrue%26MediaSourceId%3D54a41b9d586dfe007fc420d04afcd57c%26api+key%3D279cebfd1a59448da25f25b920dc20cd&fields=title%2Cmain_picture%2Calternative_titles%2Cnum_episodes%2Cmy_list_status%2Cmedia_type%2Cpopularity)

I poked around the code to see if I could find the cause of this, and if I understood correctly, Tundra uses MPRIS to get metadata of the file being played, and stores the title and filename to the build the title for use in the MAL API using Recognizers. I suppose that the recognizer that is being used is using the filename instead of the title, since the title is displayed in the player and in the media metadata.

Image

@m4tx
Copy link
Owner

m4tx commented Feb 24, 2025

Sorry for my late reply! Yes, you are correct, currently Tundra assumes that you are watching a local file, hence the filename is used to recognize the title being played.

You are also correct that recognizers are the place where this logic happens. I think it shouldn't be very difficult to add additional functionality to make this work when you have full metadata provided by MPRIS (similarly to the ani-cli recognizer here), but I just didn't have time or enough motivation to do that yet. Feel free to contribute, though, as it sounds like a feature that might be useful to a lot of people.

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