Method: Playlist#calculate_start_times
- Defined in:
- lib/playlist.rb
#calculate_start_times ⇒ Object
Calculate the start track times based on the duration. This method will only overwrite the start times, if not set
71 72 73 74 75 76 77 78 79 |
# File 'lib/playlist.rb', line 71 def calculate_start_times time = tracks.first.start_time || 0 tracks.each do |track| break if track.duration.nil? time = (track.start_time ||= time) time += track.duration end end |