Skip to content

Commit

Permalink
Show recalculated (based on speed) duration for the original file and…
Browse files Browse the repository at this point in the history
… for chapter
  • Loading branch information
isdenmois committed Jan 29, 2021
1 parent ae274ba commit 8fd253a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
3 changes: 1 addition & 2 deletions src/main/java/uk/yermak/audiobookconverter/Chapter.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
import javafx.collections.FXCollections;
import javafx.collections.ObservableList;
import org.apache.commons.lang3.StringUtils;
import uk.yermak.audiobookconverter.fx.ConverterApplication;

import java.util.*;
import java.util.function.Function;
Expand Down Expand Up @@ -65,7 +64,7 @@ public String getDetails() {

@Override
public long getDuration() {
return (long) (media.stream().mapToLong(MediaInfo::getDuration).sum() / ConverterApplication.getContext().getSpeed());
return media.stream().mapToLong(MediaInfo::getDuration).sum();
}

public String getDurationString() {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package uk.yermak.audiobookconverter;

import uk.yermak.audiobookconverter.fx.ConverterApplication;

import java.util.List;
import java.util.Objects;
import java.util.concurrent.Future;
Expand Down Expand Up @@ -40,7 +42,7 @@ public String getDetails() {
}

public long getDuration() {
return this.getMediaInfo().getDuration();
return (long) (this.getMediaInfo().getDuration() / ConverterApplication.getContext().getSpeed());
}

@Override
Expand Down

0 comments on commit 8fd253a

Please sign in to comment.