Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Repeat-one-song doesn't work with some particular songs #157

Open
Lhatna7N0l opened this issue Aug 26, 2020 · 3 comments
Open

Repeat-one-song doesn't work with some particular songs #157

Lhatna7N0l opened this issue Aug 26, 2020 · 3 comments

Comments

@Lhatna7N0l
Copy link

Lhatna7N0l commented Aug 26, 2020

I have some mp3 files downloaded from mp3quack.com which are modified with ffmpeg by myself to change/remove their covers,and some other mp3/flac/wav/other files.Let me call them Group A and Group B.
I find that when they are in the same playlist and next to each other,the repeat-one-song will not work.For example,3 songs from Group A and 3 songs from Group B are in a playlist like below,the repeat-one song feature fails when playing A3 and B3,cause they are followed by a song from the other group.While it works well when playing A1,A2,B1,B2.


|A1 |
|A2 |
|A3 |
|B1 |
|B2 |
|B3 |


This problem doesn't occur on edumucelli's repeat-one-song -> https://github.com/edumucelli/repeat-one-song .Perhaps their would be some hints.

@fossfreedom
Copy link
Owner

The repeat code is here - so that's an area to investigate https://github.com/fossfreedom/alternative-toolbar/blob/master/alttoolbar_repeat.py#L133

@Lhatna7N0l
Copy link
Author

Lhatna7N0l commented Sep 11, 2020

Sorry for the long time.Since I know little about python,I spent some time to learn and read your code.
I noticed your repeat code is similar with @edumucelli's,while there is a different in the actual practice which may related to my issue.
Both your code has an if statement:

              if time >= duration - 2:
                  player.set_playing_time(0) 

Which means to return to the beginning when a song has 2 sec left.
While in his plugin it works precisely to repeat when there were 2 sec left,in your toolbar it always goes to the end and repeat - or not,in my occasion.If you try to modify both of the code,for example to change 2 to 60,his will repeat when a song has 1 minute left,but yours won't change.(I modified /usr/lib/rhythmbox/plugins/alternative-toolbar/alttoolbar_repeat.py,is that right?)
I hadn't read all your code,but the only file had alttoolbar_repeat imported seems to be alttoolbar_type.py.I guess is the timing to call the function in alttoolbar_repeat that makes the difference.
And also,by @edumucelli's comment,RB use the last sec of a song to load next song's information.By using your toolbars,sometimes the repeat works correctly,but the cover of the song becomes the next's.This situation may proof my word above.
I think I can hardly process anymore myself,so I decided to report what I find.Hope you can find out something.

@Lhatna7N0l
Copy link
Author

Lhatna7N0l commented Sep 16, 2020

I found the solution.
Though the on_elapsed_change method exist,you didn't connect it to anything.While this is the way edumucelli used.

I add a line
player.connect('elapsed-changed', self.on_elapsed_change)
after

player.connect('playing-song-changed', self.on_song_change)

and it worked.
I don't know why but the eos way sometimes fail for me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants