Inlined getFeedPlaybackSpeed method on FeedItem
This commit is contained in:
parent
3bcb368bb3
commit
d0f19a2b14
|
@ -600,7 +600,11 @@ public class QueueFragment extends Fragment {
|
|||
if(queue.size() > 0) {
|
||||
long timeLeft = 0;
|
||||
for(FeedItem item : queue) {
|
||||
float playbackSpeed = item.getFeedPlaybackSpeed();
|
||||
float playbackSpeed = SPEED_USE_GLOBAL;
|
||||
Feed feed = item.getFeed();
|
||||
if (feed != null) {
|
||||
playbackSpeed = feed.getPreferences().getCurrentPlaybackSpeed();
|
||||
}
|
||||
if (playbackSpeed == SPEED_USE_GLOBAL) {
|
||||
playbackSpeed = UserPreferences.getPlaybackSpeed();
|
||||
}
|
||||
|
|
|
@ -486,15 +486,4 @@ public class FeedItem extends FeedComponent implements ShownotesProvider, ImageR
|
|||
return ToStringBuilder.reflectionToString(this, ToStringStyle.SHORT_PREFIX_STYLE);
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @return playback speed for this feed, or the global setting if no feed-specific setting
|
||||
*/
|
||||
public float getFeedPlaybackSpeed() {
|
||||
Feed feed = getFeed();
|
||||
if (feed != null) {
|
||||
return feed.getPreferences().getCurrentPlaybackSpeed();
|
||||
}
|
||||
return SPEED_USE_GLOBAL;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -650,7 +650,10 @@ public class FeedMedia extends FeedFile implements Playable {
|
|||
if (playbackSpeed == LAST_PLAYBACK_SPEED_UNSET) {
|
||||
FeedItem item = getItem();
|
||||
if (item != null) {
|
||||
playbackSpeed = item.getFeedPlaybackSpeed();
|
||||
Feed feed = item.getFeed();
|
||||
if (feed != null) {
|
||||
playbackSpeed = feed.getPreferences().getCurrentPlaybackSpeed();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -182,7 +182,7 @@ public class FeedPreferences {
|
|||
this.password = password;
|
||||
}
|
||||
|
||||
float getCurrentPlaybackSpeed() {
|
||||
public float getCurrentPlaybackSpeed() {
|
||||
float speed = 0.0f;
|
||||
|
||||
if (!"global".equals(feedPlaybackSpeed)) {
|
||||
|
|
Loading…
Reference in New Issue