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

Set position "selected_file" to the currently playing title after opening or through hotkey #111

Closed
dnngll opened this issue Jan 3, 2023 · 7 comments

Comments

@dnngll
Copy link

dnngll commented Jan 3, 2023

Hello,

when opening the playlist, the selected item is always the first item in the list. It would be great to have an option that would

  • scroll to and "select" the currently playing file after opening the playlist (could be switched on/off in settings)

and/or

  • have a dynamic bind that jumps to the currently playing file in the list after pressing the defined key

Does anyone else think that would make sense?

Thanks

@jonniek
Copy link
Owner

jonniek commented Jan 5, 2023

when opening the playlist, the selected item is always the first item in the list

This should not be the case if you use reset_cursor_on_close=yes. Can you show an example?

have a dynamic bind that jumps to the currently playing file in the list after pressing the defined key

This can be achieved by closing and reopening the playlist when using reset_cursor_on_close=yes. I could add a bind for this if closing and reopening is not ergonomic.

@dnngll
Copy link
Author

dnngll commented Jan 11, 2023

Hello @jonniek ,

thank you for your patience. I just got back from a vacation yesterday, hence the late reply.

To my second point: A dynamic bind is not necessary, if opening the playlist does highlight the current file. I totally agree. The reason I brought it up was, that I initially thought, opening the playlist would not do that (because it didn't). And that leads me to the real issue: There's a bug somewhere:

I realized that the behavior is sometimes as desired (opening playlist | currently played file is selected and centers), and sometimes it is not (first/other item on list is highlighted). I tried narrowing it down to path- or filename, but couldn't. The results are not reproduceable. Here's an example:

This is my folder structure:

image

I opened the 7th file (qqoumabj - S01E04 (2012) - jskvxbpg.mkv) several times in a row, and got different results. Here are 3 screenshots just after opening the file:

2023 01 11, 10 27 26

2023 01 11, 10 28 19

2023 01 11, 10 29 14

In case you want to reproduce, these are the file-names:

M:\test CANDEL\dede dedede dedede\de dddddddddd

bifpbsup - S01E11 (2012) - irdpyjvn.mkv
ggroqpyx - S01E01 (2012) - tdvstwmd.mkv
gicxyrua - S01E03 (2012) - apmclrfl.mkv
gwlhknqy - S01E09 (2012) - etrqcpta.mkv
icqiqrxd - S01E07 (2012) - vjsthqcs.mkv
pdxxevhu - S01E05 (2012) - ekgrfbqj.mkv
qqoumabj - S01E04 (2012) - jskvxbpg.mkv
rqgeayxy - S01E10 (2012) - nvkaiagv.mkv
thhtewmf - S01E06 (2012) - ysixallx.mkv
wocntqsp - S01E02 (2012) - idfjtgcp.mkv
xhgdiamt - S01E08 (2012) - fyxpccrc.mkv

If you need any more information please don't hesitate to contact me.

Thanks

@FichteFoll
Copy link

I've also noticed this behavior recently but I wasn't sure how to reliably reproduce it. I was using it on a playlist with ~300 URLs (that now also have EXTINF titles set so playlistmanager doesn't try to query for them every time) and that I had the last position saved by quitting with Q, but when I open the playlistmanager interface, I quite frequently am not looking at the currently playing entry but rather some other place, seemingly what I was at the last time the view was opened, which would be the start of the playlist when first opening it. Simply closing and then reopening the playlist usually fixes the behavior.

@dnngll
Copy link
Author

dnngll commented Jan 11, 2023

Hello @FichteFoll ,

I can confirm your last point, tried it. Plus I found another way to fix the behavior. So now there's two:

  • Open file, open playlist (bug), close playlist, open playlist (no bug)
  • Open file, move to another file via shortcut (playlist-prev), open playlist (no bug)

Tried both 10 times, 100% reproduceable

@jonniek
Copy link
Owner

jonniek commented Jan 12, 2023

I opened the 7th file (qqoumabj - S01E04 (2012) - jskvxbpg.mkv) several times in a row

What script are you using for loading the rest of the files to the playlist? There could be some problem like that script running sometimes after the file-loaded event.

There has been some changes recently in the file-loaded and file-started events that could fix some race conditions like this.

Anyway I added a setting to reset cursor when opening the playlist which should fix this issue regardless of what the root cause is/was.

jonniek added a commit that referenced this issue Jan 12, 2023
@dnngll
Copy link
Author

dnngll commented Jan 16, 2023

Hey @jonniek ,

I am using https://github.com/mpv-player/mpv/blob/master/TOOLS/lua/autoload.lua for that... Not the current version though, I got the scrip a few weeks back.

Before updating autoload, I will try your new version, and report back to you here.

Thanks

@dnngll
Copy link
Author

dnngll commented Jan 16, 2023

Hello @jonniek ,

I used the updated version, and again tried 10 times: It worked as expected every time!

Thank you so much!

@dnngll dnngll closed this as completed Jan 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
3 participants