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

[Feature Request] Support detecting anime on title metadata #751

Open
barraIhsan opened this issue Jan 10, 2025 · 9 comments
Open

[Feature Request] Support detecting anime on title metadata #751

barraIhsan opened this issue Jan 10, 2025 · 9 comments

Comments

@barraIhsan
Copy link

barraIhsan commented Jan 10, 2025

While the usual format of downloaded anime usually includes the anime name (either romaji or english title) in the filename itself, so e.g. Frieren - S1E01.mkv, there's however some provider that distribute anime with a weird formatting, like only episode information on the filename

S01E01-Like a Lone Sword [E2514310].mkv

or just a hard, and unusual filename such as

0Otakudesu_ToniKawa--01_720p.mp4

Do note however that those files have a title metadata inside and the format is

Wistoria-Wand.and.Sword.S01E01.1080p.Dual.Audio.WEBRip.10.bits.DD+.x265-EMBER

However, trackma doesn't extract title metadata for detection, and it would be really helpful to detect if somehow the title metadata is giving a lot more information (which usually do) than the filename

@barraIhsan
Copy link
Author

image
Owh, I'm dumb.

Support for title metadata would be really helpful tho, im changing the title

@barraIhsan barraIhsan changed the title [Feature Request] Support detecting anime under a directory [Feature Request] Support detecting anime on title metadata Jan 10, 2025
@barraIhsan barraIhsan changed the title [Feature Request] Support detecting anime on title metadata [Feature Request] Support detecting anime on title metadata and on english title Jan 10, 2025
@barraIhsan barraIhsan changed the title [Feature Request] Support detecting anime on title metadata and on english title [Feature Request] Support detecting anime on title metadata Jan 10, 2025
@FichteFoll
Copy link
Collaborator

FichteFoll commented Jan 11, 2025

Which tracker are you currently using and which OS? The mpris tracker prefers the title currently and I think plex and jellyfin do as well. For the strictly file-based ones, suche as inotify and polling, we could probably add metadata inspection via mediafile, an external dependency.

Either way, I occasionally get the opposite situation where the file name is easier to recognize because the title has the episode name in it, so I've been meaning to make a configuration option for it but haven't gotten around to it because it requires touching all UIs, which I've been trying to avoid unless necessary (I personally just use the CLI).

@barraIhsan
Copy link
Author

barraIhsan commented Jan 11, 2025

Which tracker are you currently using and which OS?

Arch, auto-detect so it should be using inotify by default

The mpris tracker prefers the title currently and I think plex and jellyfin do as well. For the strictly file-based ones, suche as inotify and polling

Owh yea, I tried with MPRIS (on mpv, using the mpv-mpris plugin) and it detected from the title. Yea, however the inotify—the one that got selected by default when you choose auto detect—is checking on the filename instead of the title metadata

we could probably add metadata inspection via mediafile, an external dependency.

did you mean mediainfo?

Either way, I occasionally get the opposite situation where the file name is easier to recognize because the title has the episode name in it, so I've been meaning to make a configuration option for it but haven't gotten around to it because it requires touching all UIs, which I've been trying to avoid unless necessary (I personally just use the CLI).

Yea, sometimes the title metadata is used as a... well title. So It'll probably contain something like E01 - Episode Name or something in similar, just like what ani-cli does. (They're using --force-media-title)
image

But its not always the case, just like these one
image

So my idea would be, check the filename first, then the title metadata second. As doing such, will gather a lot more info about the video

@FichteFoll
Copy link
Collaborator

did you mean mediainfo?

Yes.

So my idea would be, check the filename first, then the title metadata second.

You mean check the filename if it matches and otherwise check again with the title? That sounds reasonable. However, the tracker code is a bit of spaghetti currently and I would prefer to clean it up before implementing such a retry mechanism (for every tracker that can support it). And cleaning up the code would be better done after we have updated tooling and revised the formatting of the code base because the current one with a column with of what seems like 60 makes me want to shoot myself in the foot whenever I read it and need to refrain from just fixing it to avoid conflicts.

Alas, issue received. Will probably be worked on at some point.

@barraIhsan
Copy link
Author

barraIhsan commented Jan 18, 2025

Weird that not all title (I used MPRIS, so Guessing filename is from the title metadata right?) are detected. Take Mushoku Tensei from EMBER group for example

[D] Tracker (MPRIS): Player connected: org.mpris.MediaPlayer2.mpv                          
[D] Tracker (MPRIS): Guessing filename: Mushoku.Tensei.S01E01.1080p.Dual.Audio.BDRip.10.bits.DD.x265-EMBER
[D] Tracker (MPRIS): Show guess: Mushoku Tensei: None - 1                                  
[D] Tracker (MPRIS): Video not recognized

It said Show guess: Mushoku Tensei but it's failed to recognize

@FichteFoll
Copy link
Collaborator

FichteFoll commented Jan 19, 2025

Mushoku Tensei is what it reads from the title. However, it then fails to match this with an entry from your list because the English title is "Mushoku Tensei: Jobless Reincarnation" and the title in Romaji is "Mushoku Tensei: Isekai Ittara Honki Dasu". trackma cannot (currently) match parts of titles, so you'd need to add an altname for this entry as "Mushoku Tensei".

I also run into this every season and I also tried to submit aliases to Anilist, since trackma also attempts to match aliases, but the edits are rejected because Anilist's search itself is unaffected by this limitation since it can match parts of the title (and the user is then tasked with selecting the intended result from a list). I think we could cope a bit by splitting on colons in titles and attempt to match the first part as well, but that's a different issue.

@barraIhsan
Copy link
Author

barraIhsan commented Jan 20, 2025

However, it then fails to match this with an entry from your list because the English title is "Mushoku Tensei: Jobless Reincarnation" and the title in Romaji is "Mushoku Tensei: Isekai Ittara Honki Dasu". trackma cannot (currently) match parts of titles, so you'd need to add an altname for this entry as "Mushoku Tensei".

Ok, so currently trackma matches for the Romaji and the English title, but only for the full title. But we can give it an alias using the Change alternate name (didn't know that before).

Image

Oh yeah it does work.

I also run into this every season and I also tried to submit aliases to Anilist, since trackma also attempts to match aliases, but the edits are rejected because Anilist's search itself is unaffected by this limitation since it can match parts of the title (and the user is then tasked with selecting the intended result from a list). I think we could cope a bit by splitting on colons in titles and attempt to match the first part as well, but that's a different issue.

wait you can do that on anilist?

Image

Ahhh this one?

@FichteFoll
Copy link
Collaborator

FichteFoll commented Jan 20, 2025

Yes, those are the synonyms that trackma also considers for matching.

@FichteFoll
Copy link
Collaborator

FichteFoll commented Jan 20, 2025

I have created #754 for the other topic.

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

No branches or pull requests

2 participants