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

Assign duration information so it's available in episode list view wi… #105

Merged
merged 2 commits into from
Aug 17, 2022

Conversation

woj-tek
Copy link
Contributor

@woj-tek woj-tek commented Aug 12, 2022

Assign duration information so it's available in episode list view without starting playback; #45

@@ -184,6 +184,11 @@ class Episode: Record {
pubDate = feedItem.pubDate
link = feedItem.link

let duration = feedItem.iTunes?.iTunesDuration
if (duration != nil) {
self.duration = Int(duration!)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Force unwrapping (! operator) is generally considered as a code smell and should be avoided as possible. A if let statement can be used instead of if (duration != nil) to avoid the force unwrapping.

@@ -184,6 +184,11 @@ class Episode: Record {
pubDate = feedItem.pubDate
link = feedItem.link

let duration = feedItem.iTunes?.iTunesDuration
if (duration != nil) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

It's generally recommended to omit the parentheses around if conditionals for Swift code.

@woj-tek
Copy link
Contributor Author

woj-tek commented Aug 16, 2022

Thank you for the comments, I think it should be better now. I didn't address playbackDuration from the discussion.

@dyerc dyerc merged commit 2f08b02 into dyerc:master Aug 17, 2022
@GetToSet GetToSet linked an issue Aug 17, 2022 that may be closed by this pull request
@GetToSet GetToSet added this to the v2.0.1 milestone Aug 17, 2022
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.

FR: information about episode length even before playback
3 participants