fossfreedom / alternative-toolbar

Modern, minimal and music-focused interface for Rhythmbox
GNU General Public License v3.0
156 stars 20 forks source link

Repeat Current Track doesn't update Play Count #104

Open eloyekunle opened 7 years ago

eloyekunle commented 7 years ago

What's up people, Great plugin! Love it! I'm probably the only one who enables the Play Count column in RB (need to keep track and stuff, you know?) Well, Repeat Current Track doesn't update the play count at all. I've noticed the same on Ubuntu 15.10 (Unity), 16.04 (Unity), 16.10 (Unity) and currently 17.04 (GNOME) (been using the plugin for quite a while, ya know?). I summoned my courage today, after years of hiding in the closet, to report the bug. Let's see what we can do to fix the bug, people. I'll be cheering in the sidelines. Of course, if you're busy and stuff, you can give me some pointers and I'll figure out how to fix it myself and slam a PR on the table like what???? Thanks.

--- Want to back this issue? **[Post a bounty on it!](https://www.bountysource.com/issues/47859306-repeat-current-track-doesn-t-update-play-count?utm_campaign=plugin&utm_content=tracker%2F10046800&utm_medium=issues&utm_source=github)** We accept bounties via [Bountysource](https://www.bountysource.com/?utm_campaign=plugin&utm_content=tracker%2F10046800&utm_medium=issues&utm_source=github).
fossfreedom commented 7 years ago

Hmm. Interesting.

Alttoolbar_repeat.py

It uses the elapsed change event

So when the track gets to the end of the song, the time is reset back to zero.

I suppose that is confusing rhythmbox because the song never actually finishes.

I'm not sure if there is a play count type API. If there is one then we should call it at the end of the song to increment the count.

fossfreedom commented 7 years ago

in the Repeat class is the on_elapsed_change method.

You have the player var - that should be the shell_player https://lazka.github.io/pgi-docs/#RB-3.0/classes/ShellPlayer.html#RB.ShellPlayer.get_playing_entry

get the playing entry RBEntry

I think then we have to do something with the metadata https://lazka.github.io/pgi-docs/#RB-3.0/classes/RhythmDBEntry.html#RB.RhythmDBEntry

Probably https://lazka.github.io/pgi-docs/#RB-3.0/classes/RhythmDBEntry.html#RB.RhythmDBEntry.sync_metadata

Where need to get the old value of https://lazka.github.io/pgi-docs/#RB-3.0/classes/RhythmDBEntryChange.html#RB.RhythmDBEntryChange https://lazka.github.io/pgi-docs/#RB-3.0/enums.html#RB.RhythmDBPropType.PLAY_COUNT and add the new value of RhythmDBEntryChange and then call sync changes.

eloyekunle commented 7 years ago

Hmm. Interesting. I'll look at the resources you sent. Thanks.