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 Movie/Show trailers #115

Merged
merged 12 commits into from
Sep 23, 2024
Merged

Feature Movie/Show trailers #115

merged 12 commits into from
Sep 23, 2024

Conversation

hadi-norouzi
Copy link
Collaborator

Thank you for opening a Pull Request! Before submitting your PR, there are a few things you can do to make sure it goes smoothly.

Take a look at the contributing guidelines for this project.

Description

Checklist

  • Make sure to open a GitHub issue as a bug/feature request before writing your code! That way we can discuss the change, evaluate designs, and agree on the general idea
  • Ensure the linter (code style) passes
  • Appropriate docs were updated (if necessary)

Fixes #<issue_number_goes_here>

moallemi
moallemi previously approved these changes Sep 23, 2024
Comment on lines +22 to +32
companion object {
const val YOUTUBE_WATCH_PAGE = "https://youtube.com/watch?v="
const val YOUTUBE_THUMBNAIL_URL = "https://img.youtube.com/vi/{id}/hqdefault.jpg"
}

Copy link
Owner

Choose a reason for hiding this comment

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

💅 Better to move it to the end of the class

https://kotlinlang.org/docs/coding-conventions.html#class-layout

Comment on lines +25 to +35
companion object {
const val YOUTUBE_WATCH_PAGE = "https://youtube.com/watch?v="
const val YOUTUBE_THUMBNAIL_URL = "https://img.youtube.com/vi/{id}/hqdefault.jpg"
}

Copy link
Owner

Choose a reason for hiding this comment

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

💅 Better to move it to the end of the class

https://kotlinlang.org/docs/coding-conventions.html#class-layout

.fillMaxWidth()
.wrapContentSize(),
)
} else if (items.isNotEmpty()) {
Copy link
Owner

Choose a reason for hiding this comment

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

Need to handle no trailers state

Comment on lines 59 to 70
Box(
modifier = Modifier
.align(Alignment.BottomCenter)
.fillMaxWidth()
.background(Color.Black.copy(alpha = 0.7f))
.padding(4.dp),
) {
Text(
modifier = Modifier
.padding(horizontal = 12.dp, vertical = 4.dp),
text = video.name,
style = MaterialTheme.typography.titleMedium,
overflow = TextOverflow.Ellipsis,
minLines = 1,
maxLines = 3,
)
}
}
Copy link
Owner

Choose a reason for hiding this comment

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

We do not need this title

Comment on lines 121 to 132
val body = result.body
if (body == null) {
Result.Failure(GeneralError.UnknownError(Throwable("Videos is null")))
}
Result.Success(body!!.results.map { it.toVideos() })
}
Copy link
Owner

Choose a reason for hiding this comment

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

Line 125 will always crash if body == null, you forgot to add if/else

if (body == null) {
Result.Failure(GeneralError.UnknownError(Throwable("Videos is null")))
}
Result.Success(body!!.results.map { it.toVideos() })
Copy link
Owner

Choose a reason for hiding this comment

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

Line 140 will always crash if body == null, you forgot to add if/else

@moallemi moallemi merged commit 74d23e9 into dev Sep 23, 2024
1 check passed
@moallemi moallemi deleted the feature/trailers branch September 23, 2024 05:15
@moallemi moallemi restored the feature/trailers branch September 23, 2024 05:15
@moallemi moallemi deleted the feature/trailers branch September 23, 2024 05:15
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