Kodi Community Forum
XBMC loses place in file list when files are added - Printable Version

+- Kodi Community Forum (https://forum.kodi.tv)
+-- Forum: Support (https://forum.kodi.tv/forumdisplay.php?fid=33)
+--- Forum: General Support (https://forum.kodi.tv/forumdisplay.php?fid=111)
+---- Forum: OS independent / Other (https://forum.kodi.tv/forumdisplay.php?fid=228)
+---- Thread: XBMC loses place in file list when files are added (/showthread.php?tid=131331)



XBMC loses place in file list when files are added - tobiasfunky - 2012-05-11

Setup: XBMC Eden iOS, browsing file share mounted via SAMBA.

Play video, on file server add a file (with a name that sorts before the video being played), stop video and the selected video is not the one playing.


RE: XBMC loses place in file list when files are added - Chris! - 2012-05-11

So you want the cursor where you left it before you added a video file. Surely it's just moved by one position ?


RE: XBMC loses place in file list when files are added - tobiasfunky - 2012-05-15

usually it has just moved by one position, but it is annoying.

i'm usually watching a video that gets interrupted b/c of a network glitch and i quickly hit play to restart it and wind up playing a different video.

should be an easy fix?


RE: XBMC loses place in file list when files are added - Ned Scott - 2012-05-16

XBMC might believe it has come to the end of the file (since the data stopped abruptly, despite the timestamps) and selects the next item?


RE: XBMC loses place in file list when files are added - jmarshall - 2012-05-16

No, it's because we keep only the index into the list of items, not the path (or other characteristics). If someone wants to take a look, see GUIMediaWindow.cpp


RE: XBMC loses place in file list when files are added - teaguecl - 2012-05-16

(2012-05-11, 22:19)tobiasfunky Wrote: Setup: XBMC Eden iOS, browsing file share mounted via SAMBA.

Play video, on file server add a file (with a name that sorts before the video being played), stop video and the selected video is not the one playing.

I filed a bug on this issue, submitted 3 patches for it. That was 18 months ago, I gave up.
http://trac.xbmc.org/ticket/10493


RE: XBMC loses place in file list when files are added - jmarshall - 2012-05-16

Thanks teaguecl - looks like I dropped the ball on this one. I'll pull the patch up to date and see if anything else is needed.

Cheers,
Jonathan


RE: XBMC loses place in file list when files are added - jmarshall - 2012-05-17

Thinking through it a bit it's not as simple as the patch makes out unfortunately (relying on path alone fails for cases where the path is the same for multiple items - .cue sheets for example). Will branch and start work, but I don't expect it to be completed quickly.

I'll push the branch up to github once done in case someone else has time.

Cheers,
Jonathan


RE: XBMC loses place in file list when files are added - jmarshall - 2012-05-23

Ok, here's the branch:

https://github.com/jmarshallnz/xbmc/commits/reselect_path

It needs some work. In particular:

1. Path alone isn't enough for checking items. You need to use something similar to CFileItem::IsSamePath, but there's some issues with that as well (you shouldn't assume that m_lStartOffset is essentail for matching - for video items it's not for example, for music items it is).

2. There will also be an item index being stored by the container itself (GUIBaseContainer subclasses) which will be being restored in CGUIWindow::OnInitWindow. I'm not sure if simply setting the item focus again after there (or indeed, not setting it before and only setting it after) is enough to cause no issues. In particular, there may be issues with lists animating on first entry due to changed focus position which may be noticeable - needs testing.

Cheers,
Jonathan