Mark spotify streams as not seekable
This commit is contained in:
parent
22e6a649b7
commit
05460f9975
|
@ -941,7 +941,8 @@ void LastFMService::TuneFinished() {
|
|||
|
||||
PlaylistItem::Options LastFMService::playlistitem_options() const {
|
||||
return PlaylistItem::LastFMControls |
|
||||
PlaylistItem::PauseDisabled;
|
||||
PlaylistItem::PauseDisabled |
|
||||
PlaylistItem::SeekDisabled;
|
||||
}
|
||||
|
||||
PlaylistItemPtr LastFMService::PlaylistItemForUrl(const QUrl& url) {
|
||||
|
|
|
@ -475,7 +475,7 @@ void SpotifyService::SongFromProtobuf(const spotify_pb::Track& track, Song* song
|
|||
}
|
||||
|
||||
PlaylistItem::Options SpotifyService::playlistitem_options() const {
|
||||
return PlaylistItem::PauseDisabled;
|
||||
return PlaylistItem::PauseDisabled | PlaylistItem::SeekDisabled;
|
||||
}
|
||||
|
||||
void SpotifyService::EnsureMenuCreated() {
|
||||
|
|
|
@ -47,6 +47,9 @@ class PlaylistItem : public boost::enable_shared_from_this<PlaylistItem> {
|
|||
|
||||
// Enables the last.fm "ban" action.
|
||||
LastFMControls = 0x02,
|
||||
|
||||
// Disables the seek slider.
|
||||
SeekDisabled = 0x04,
|
||||
};
|
||||
Q_DECLARE_FLAGS(Options, Option);
|
||||
|
||||
|
|
|
@ -875,6 +875,9 @@ void MainWindow::MediaPlaying() {
|
|||
bool enable_play_pause = !(player_->GetCurrentItem()->options() & PlaylistItem::PauseDisabled);
|
||||
ui_->action_play_pause->setEnabled(enable_play_pause);
|
||||
|
||||
bool can_seek = !(player_->GetCurrentItem()->options() & PlaylistItem::SeekDisabled);
|
||||
ui_->track_slider->SetCanSeek(can_seek);
|
||||
|
||||
#ifdef HAVE_LIBLASTFM
|
||||
bool is_lastfm = (player_->GetCurrentItem()->options() & PlaylistItem::LastFMControls);
|
||||
LastFMService* lastfm = InternetModel::Service<LastFMService>();
|
||||
|
@ -887,10 +890,7 @@ void MainWindow::MediaPlaying() {
|
|||
tray_icon_->LastFMButtonLoveStateChanged(enable_love);
|
||||
|
||||
tray_icon_->SetPlaying(enable_play_pause, enable_ban, enable_love);
|
||||
|
||||
ui_->track_slider->SetCanSeek(!is_lastfm);
|
||||
#else
|
||||
ui_->track_slider->SetCanSeek(true);
|
||||
tray_icon_->SetPlaying(enable_play_pause);
|
||||
#endif
|
||||
|
||||
|
|
Loading…
Reference in New Issue