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

Knocking out LC requirements in issue #2124 #2125

Merged
merged 16 commits into from
Apr 16, 2018

Conversation

anojht
Copy link
Contributor

@anojht anojht commented Apr 5, 2018

This PR is a WIP and will serve the changes required for LC to reach completion.

@anojht anojht changed the title Knocking out some more LC changes Knocking out LC requirements in issue #2124 Apr 5, 2018
}

if (val.data.imdbId.length === 0) {
this.searchService.getShowInformationTreeNode(val.data.tvDbId).subscribe(x => {
Copy link
Member

Choose a reason for hiding this comment

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

We shouldn't be using the SearchService to get the TvDbId and Imdbid.

There should be a new API if we need this information, or return it as part of the current API

Copy link
Contributor Author

Choose a reason for hiding this comment

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

In search results the TreeNode data has seriesId attribute which can be used with the url: https://www.tvmaze.com/shows/{seriesId} in order to display titles with urls in the event that that tvmaze data does not contain an imdbId for the particular show.

However inside the requests page the TreeNode data does not have a seriesId attribute, so the only way I thought of to get this since we do have the tvDbId is to use the search service call to obtain this very reliably and this way tv show titles don't just link to a 404 imdb page.

What do you think is a better approach? I mean we can set the imdbId attribute accordingly during search so we don't have to do this and this would work for new requests but then I was just thinking of the existing requests...

Copy link
Member

Choose a reason for hiding this comment

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

Well we do try and set the IMDb Id, but we can't always get it because it's not available sometimes. What I'd recommend is if we dont have it then we either create a new api and get it OR get it on the requests API that returns the requested items.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ok I will investigate this further. What I am leaning towards is using OMDb API since if we pass it the exact title we get from TvMaze it seems to return a reliable result which has the IMDb Id 😃

Copy link
Member

Choose a reason for hiding this comment

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

That's fine! We just need a new API assembly like all the other external API's.

Should be pretty simple to do.

Copy link
Member

@tidusjar tidusjar left a comment

Choose a reason for hiding this comment

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

Nice job!

if (result.Name == ShowInfo.name)
{
var showIds = await MovieDbApi.GetTvExternals(result.Id);
ShowInfo.externals.imdb = showIds.imdb_id;
Copy link
Member

Choose a reason for hiding this comment

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

Since we are here we can store TheMovieDbId too.

Copy link
Contributor Author

@anojht anojht Apr 11, 2018

Choose a reason for hiding this comment

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

ShowInfo here is of type TvMazeShow and it does not have TheMovieDbId as one of its attributes. Examining this more closely, tvrequests do not have TheMovieDbId as an attribute anywhere.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Wrote a DB migration and extended the TvRequests to include TheMovieDbId and it seems to be working beautifully. Is this ok to do? If so I will push the commit.

} else {
val.data.imdbId = "http://www.imdb.com/title/" + val.data.imdbId + "/";
}
val.data.imdbId = "http://www.imdb.com/title/" + val.data.imdbId + "/";
Copy link
Member

Choose a reason for hiding this comment

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

This is not really the imdbId. I assume we use this on the UI. I'd prefer if we just do this in the UI

public filterAvailability(filter: FilterType, el: any) {
el = el.toElement || el.relatedTarget || el.target || el.srcElement;

el = el.parentElement; //gets radio div
Copy link
Member

Choose a reason for hiding this comment

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

Can we not move this part of the code into it's own private method? Since it's used below too

el = el.parentElement; //gets form group div
el = el.parentElement; //gets status filter div
el = el.querySelectorAll("INPUT");
for (el of el) {
Copy link
Member

Choose a reason for hiding this comment

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

See above

if (val.posterPath === null) {
val.posterPath = "../../../images/default_movie_poster.png";
} else {
val.posterPath = "https://image.tmdb.org/t/p/w300/" + val.posterPath;
Copy link
Member

Choose a reason for hiding this comment

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

Again can we put the concatenation in the UI?

if (req.posterPath === null) {
req.posterPath = "../../../images/default_movie_poster.png";
} else {
req.posterPath = "https://image.tmdb.org/t/p/w300/" + req.posterPath;
Copy link
Member

Choose a reason for hiding this comment

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

Can this go in the HTML, please?

Copy link
Contributor Author

@anojht anojht left a comment

Choose a reason for hiding this comment

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

This PR is done 😄 Please review!

@tidusjar tidusjar merged commit bc4db41 into Ombi-app:develop Apr 16, 2018
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.

2 participants