+
Skip to content

Added alternative titles #426

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

Merged
merged 2 commits into from
Jun 27, 2022

Conversation

nerg4l
Copy link
Collaborator

@nerg4l nerg4l commented Jun 10, 2022

This PR adds logic for parsing alternative titles. Not sure if this is the best logic for doing this so I'm open for suggestions.

Resolves #397

@nerg4l nerg4l force-pushed the feature/alternative-titles branch from dcb1be8 to fa74456 Compare June 10, 2022 08:35
@nerg4l nerg4l force-pushed the feature/alternative-titles branch from fa74456 to 4ba83b0 Compare June 10, 2022 12:09
@irfan-dahir irfan-dahir self-requested a review June 14, 2022 01:37
Copy link
Collaborator

@irfan-dahir irfan-dahir left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The approach looks good to me.

It does repeat values for title english and japanese. I guess we can gracefully deprecate that in the next major release? I'm thinking along the lines of grouping all titles into one object for the next major release which should handle the scaling here.

@@ -189,6 +194,7 @@ public static function fromParser(MangaParser $parser): Manga
$instance->titleEnglish = $parser->getMangaTitleEnglish();
$instance->titleSynonyms = $parser->getMangaTitleSynonyms();
$instance->titleJapanese = $parser->getMangaTitleJapanese();
$instance->alternativeTitles = $parser->getAlternativeTitles();
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@nerg4l Should this be titleAlternatives in order to match the naming order of the rest (titleEnglish, titleSynonyms, titleJapanese)?

Which would get auto serialized to title_alternatives by the REST API.

@nerg4l
Copy link
Collaborator Author

nerg4l commented Jun 21, 2022

I think we could already group the titles and expose a titles property.

@irfan-dahir
Copy link
Collaborator

@nerg4l This would be a major version change though?

@nerg4l
Copy link
Collaborator Author

nerg4l commented Jun 21, 2022

We would keep the current properties just instead of titleAlternatives we would add titles. The only thing we need in this case is a key/name for the "official" title.

@irfan-dahir
Copy link
Collaborator

@nerg4l That sounds good. And then we can remove the other title properties later on.

Perhaps we can call the "official title" just default?

I could see it working like this
->getTitltes()->getDefault()

@nerg4l
Copy link
Collaborator Author

nerg4l commented Jun 21, 2022

getTitleAlternatives() returns an array but to be able to call getDefault() it has to return a collection object.

@nerg4l nerg4l force-pushed the feature/alternative-titles branch from 5f80cbc to e270663 Compare June 21, 2022 15:48
@irfan-dahir
Copy link
Collaborator

@nerg4l You're right. Confused the response here with another's.

@irfan-dahir irfan-dahir merged commit d9e6529 into jikan-me:master Jun 27, 2022
@nerg4l
Copy link
Collaborator Author

nerg4l commented Jun 27, 2022

I was planning to rename the exposed property to titles.

@irfan-dahir
Copy link
Collaborator

@nerg4l I've reverted it, can you PR it again?

@nerg4l
Copy link
Collaborator Author

nerg4l commented Jun 27, 2022

Tomorrow I will have time.

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

Successfully merging this pull request may close these issues.

Include more languages for show alternative titles
2 participants
点击 这是indexloc提供的php浏览器服务,不要输入任何密码和下载