mirror of
https://github.com/clementine-player/Clementine
synced 2025-01-11 09:24:50 +01:00
Merge pull request #4957 from eduardosm/esm-branch1
mpris: Fix track not restarting when playing the first track on the…
This commit is contained in:
commit
1a968b3a64
@ -244,7 +244,8 @@ int Mpris1Player::GetCaps(Engine::State state) const {
|
|||||||
if (playlists->active()->next_row() != -1) {
|
if (playlists->active()->next_row() != -1) {
|
||||||
caps |= CAN_GO_NEXT;
|
caps |= CAN_GO_NEXT;
|
||||||
}
|
}
|
||||||
if (playlists->active()->previous_row() != -1) {
|
if (playlists->active()->previous_row() != -1 ||
|
||||||
|
app_->player()->PreviousWouldRestartTrack()) {
|
||||||
caps |= CAN_GO_PREV;
|
caps |= CAN_GO_PREV;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -305,6 +305,13 @@ void Player::StopAfterCurrent() {
|
|||||||
app_->playlist_manager()->active()->current_row());
|
app_->playlist_manager()->active()->current_row());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool Player::PreviousWouldRestartTrack() const {
|
||||||
|
// Check if it has been over two seconds since previous button was pressed
|
||||||
|
return menu_previousmode_ == PreviousBehaviour_Restart &&
|
||||||
|
last_pressed_previous_.isValid() &&
|
||||||
|
last_pressed_previous_.secsTo(QDateTime::currentDateTime()) >= 2;
|
||||||
|
}
|
||||||
|
|
||||||
void Player::Previous() { PreviousItem(Engine::Manual); }
|
void Player::Previous() { PreviousItem(Engine::Manual); }
|
||||||
|
|
||||||
void Player::PreviousItem(Engine::TrackChangeFlags change) {
|
void Player::PreviousItem(Engine::TrackChangeFlags change) {
|
||||||
|
@ -142,6 +142,8 @@ class Player : public PlayerInterface {
|
|||||||
|
|
||||||
const UrlHandler* HandlerForUrl(const QUrl& url) const;
|
const UrlHandler* HandlerForUrl(const QUrl& url) const;
|
||||||
|
|
||||||
|
bool PreviousWouldRestartTrack() const;
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
void ReloadSettings();
|
void ReloadSettings();
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user