Skip to content

Commit

Permalink
Fix PlaylistView and stringDurationToSeconds() (nukeop#675)
Browse files Browse the repository at this point in the history
* Fix stringDurationToSeconds to not return results like 5:05, 6:06, etc

* Fix PlaylistView to use an artPlaceholder in case no thumbnail is found
  • Loading branch information
Dola-Shuvi authored Mar 18, 2020
1 parent 7e25f04 commit f950f82
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion packages/app/app/components/PlaylistView/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ class PlaylistView extends React.Component {
<div>
<img
className={styles.playlist_thumbnail}
src={_.get(playlist, 'tracks[0].thumbnail', '')}
src={_.get(playlist, 'tracks[0].thumbnail', artPlaceholder)}
/>
</div>
<div className={styles.playlist_header}>
Expand Down
2 changes: 1 addition & 1 deletion packages/app/app/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export function stringDurationToSeconds(duration) {
if (parts.length === 2) {
parts.unshift(0);
}
return parseInt(parts[0]) * 3600 + parseInt(parts[1]) * 60 + parseInt(parts[1]);
return parseInt(parts[0]) * 3600 + parseInt(parts[1]) * 60 + parseInt(parts[2]);
}
return 0;
}
Expand Down

0 comments on commit f950f82

Please sign in to comment.