sorting by file in "files" mode
#1
it seems to me that it would be better to use the basename in basePath instead of pathandfilename as the key for the sort.
basePath seem to be the same as pathandfilename if use foldername is not enabled and is the path for the folder otherwise

I have most of my videos named DVD (in the case of DVDs and lots of video.avi ...
While I have been converting my library it has been a great help as most all of the scraped files sort together (video.avi and VIDEO_TS.IFO) and the unscraped ones are all together at the top!
Never the less, on an ongoing basis it really isn't intuitive.

If this is thought to be wrong, how about a new search type on the basePath - which I will gladly do if someone can suggest a reasonable name - I'm assuming the general user will not find basePath particularly informative!

thanks
mike
Reply
#2
Why would the order change between the two, given that basePath is just the first N characters of pathandfilename (and thus will typically sort identically).
Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.


Image
Reply
#3
the sort is done on the last element of the filename - makes sense you should only be listing the parent's files (in filemode).
However, if there is a videotag the filename (and the sort key) get replaced by the videotag's pathandfilename, which eventually just becomes filename.
I did dream last night (I have no life!) that I didn't test it with the option to not use library names for file lists, to see what happens, but my test library is in a mess and I'm having trouble connecting to TMDB/TVDB (I rebased everything - so who knows) so I can't really test things right now.
I will rewind some of my stuff and verify it does the right things.

mike

EDIT: I have verified that both with and without the use library names for file lists operates in the same way
Reply
#4
So the problem is it ends up sorting using VIDEO_TS.IFO?

Perhaps an example listing in the order it's sorted by label + file may help explain the problem?
Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.


Image
Reply
#5
(2012-10-30, 01:41)jmarshall Wrote: So the problem is it ends up sorting using VIDEO_TS.IFO?

Perhaps an example listing in the order it's sorted by label + file may help explain the problem?
yes

what follows is from my log Movies6 is without the "movies in separate folders option and Movies - in folders is with).
Its a bit confused and dense, but you get the idea
First as it is and then with my change. What you would see in list mode in the first case is AVATAR, DVD2.iso, kill bill, MOMMO, Artifical intelligence and so on for the others

20:58:09 T:140603707533184 DEBUG: CGUIMediaWindow::GetDirectory (/xbmc/xbmc/test/Movies6/)
20:58:09 T:140603707533184 DEBUG: mikeConfusedort item /xbmc/xbmc/test/Movies6/AVATAR/ sort key AVATAR 0
20:58:09 T:140603707533184 DEBUG: mikeConfusedort item /xbmc/xbmc/test/Movies6/DVD2.iso sort key DVD2.iso 0
20:58:09 T:140603707533184 DEBUG: mikeConfusedort item /xbmc/xbmc/test/Movies6/kill bill/ sort key kill bill 0
20:58:09 T:140603707533184 DEBUG: mikeConfusedort item /xbmc/xbmc/test/Movies6/MOMMO/ sort key MOMMO 0
20:58:09 T:140603707533184 DEBUG: mikeConfusedort item /xbmc/xbmc/test/Movies6/Artifical intelligence/VIDEO_TS/VIDEO_TS.IFO sort key VIDEO_TS.IFO 0

20:58:13 T:140603707533184 DEBUG: CGUIMediaWindow::GetDirectory (/xbmc/xbmc/test/Movies - folders/)
20:58:13 T:140603707533184 DEBUG: mikeConfusedort item /xbmc/xbmc/test/Movies - folders/AVATAR/ sort key AVATAR 0
20:58:13 T:140603707533184 DEBUG: mikeConfusedort item /xbmc/xbmc/test/Movies - folders/MOMMO/DVD.iso sort key DVD.iso 0
20:58:13 T:140603707533184 DEBUG: mikeConfusedort item /xbmc/xbmc/test/Movies - folders/DVD2.iso sort key DVD2.iso 0
20:58:13 T:140603707533184 DEBUG: mikeConfusedort item /xbmc/xbmc/test/Movies - folders/kill bill/jaws.mp4 sort key jaws.mp4 0
20:58:13 T:140603707533184 DEBUG: mikeConfusedort item /xbmc/xbmc/test/Movies - folders/Artificial intelligence/VIDEO_TS/VIDEO_TS.IFO sort key VIDEO_TS.IFO 0

and this is with the change

21:00:05 T:140635951171456 DEBUG: CGUIMediaWindow::GetDirectory (/xbmc/xbmc/test/Movies6/)
21:00:05 T:140635951171456 DEBUG: mikeConfusedort item /xbmc/xbmc/test/Movies6/Artifical intelligence/ sort key Artifical intelligence 0
21:00:05 T:140635951171456 DEBUG: mikeConfusedort item /xbmc/xbmc/test/Movies6/AVATAR/ sort key AVATAR 0
21:00:05 T:140635951171456 DEBUG: mikeConfusedort item /xbmc/xbmc/test/Movies6/DVD2.iso sort key DVD2.iso 0
21:00:05 T:140635951171456 DEBUG: mikeConfusedort item /xbmc/xbmc/test/Movies6/kill bill/ sort key kill bill 0
21:00:05 T:140635951171456 DEBUG: mikeConfusedort item /xbmc/xbmc/test/Movies6/MOMMO/ sort key MOMMO 0

21:00:05 T:140635951171456 DEBUG: CGUIMediaWindow::GetDirectory (/xbmc/xbmc/test/Movies - folders6/)
21:00:08 T:140635951171456 DEBUG: mikeConfusedort item /xbmc/xbmc/test/Movies - folders/Artificial intelligence/ sort key Artificial intelligence 0
21:00:08 T:140635951171456 DEBUG: mikeConfusedort item /xbmc/xbmc/test/Movies - folders/AVATAR/ sort key AVATAR 0
21:00:08 T:140635951171456 DEBUG: mikeConfusedort item /xbmc/xbmc/test/Movies - folders/DVD2.iso sort key DVD2.iso 0
21:00:08 T:140635951171456 DEBUG: mikeConfusedort item /xbmc/xbmc/test/Movies - folders/kill bill/ sort key kill bill 0
21:00:08 T:140635951171456 DEBUG: mikeConfusedort item /xbmc/xbmc/test/Movies - folders/MOMMO/ sort key MOMMO 0




after having looked at this some more I am sure (IMHO) that it is a bug. Probably the correct fix is not to let CVideoInfoTag::ToSortable set the sort field FieldPath to basePath, but rather leave it alone as it is already set to the strPath of the item, which if your looking at a directory is what you would expect stuff to be sorted on (BTW this turns out to be of course basePath of the Movie)
Reply
#6
I'm not sure if leaving it as m_strPath will help - one presumes that will be the stacked down path so you'd have the same issue with VIDEO_TS.IFO ?
Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.


Image
Reply
#7
After going down a long and dark path trying to figure out the stacking stuff I think it is immaterial.

To start with my tests work (not definitive, but a good sign), the m_strPath that I was referring to is the m_strPath of the item, not the videoinfotag's. as far as I can tell (my version of confluence displays the item's path/filename) the path of the filelist is not munged; however, you know much more than I on the matter so whatever you think best.

As a note I have checked other uses of sort by file and I think this is th only use with videoinfotags, so I do not believe the change will screw anything else up

mike

EDIT: I have to stop forgetting to actually post messages after previewing them Oh well...

after once again thinking about this while I was supposed to be sleeping (or while I was sleeping), I think the semantics of using the item's m_strPath is the correct one. After all it is a sort on a list of fileItems. IMHO
Reply
#8
Ok, I was a little slow on Monday - those 3 pint lunches can slow you down!

Indeed enabling stacking does "get it wrong" again, so I am back to m_basePath which seems to give the expected (IMHO) correct results

PS. I did it again, this should have been posted yesterday - and no beers!
Reply
#9
Sorry to take a step back, but what is the purpose of you using Sort by: File anyway? Why not just sort by Label?
Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.


Image
Reply
#10
No need to be sorry it is a great question. I replied to this yesterday and yet again forgot to click the right button and finally post - I don't know why I have so much trouble here, must be getting senile - but I rebooted and it is lost. It was a really long post so perhaps it is for the best!

As I initially posted I actually liked the screwy sorting because it effectively became sort by folder if no video info, sort by VIDEO_TS.IFO or video.avi if there was, though I didn't realize it at the time. This made it convenient for fixing/adding scraping info

Since I have "fixed" it, I like the fact that the list doesn't change every time I correct/add video info, which I could duplicate by sort by label and disable the "replace file names with library titles" option, but that makes it harder to see which video need info and is painful to switch back and forth.

I had checked for sorting by file and didn't think this would affect anything, but I didn't think about playlists and sort by path, though I strongly believe that sort by path is flawed (I thought about it as a replacement for sort by file) because of multipaths and even in a playlist sort by file will give you unexpected results.

My (and I believe others) expectation of sort by file would be that it would be in the same order as the sort by name without the "replace file names with library titles". I.e. the same as an ls (or dir) would on the directory.

Regardless, I'm a great believer in "If you're going to do something do it right or don't do it.", so if it were up to me I would either drop "sort by file" as an option or fix it with a new sort type that meets my expectations above with preference to the former at this stage of the development cycle.

Reply
#11
Sort By File's design is to use the file and ignore any folders. The latter bit is the main reason folk use it. I believe that we ignore folders once stacked anyway when sorting by label, there's not as much reason to allow this now.

The main reason I'm hesitant to change things is that FieldPath should return the path field for the item. Thus, return m_basePath isn't correct in any sense - it's not the path to the item at all. If FieldPath was specific to sorting, then it would be OK (it is at the moment, but may not be in future).
Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.


Image
Reply
#12
What about an advancedsettings.xml option to include folders when sorting by Name?

AFAIK there's currently no way to sort files AND folders in 'video files mode'.

Sorting by File does not correctly sort all video files. Some video files are shown first (unalfabetically) even if metadata info is blank. This issue exists in both Eden as well as in the latest Frodo nightlies.
Reply

Logout Mark Read Team Forum Stats Members Help
sorting by file in "files" mode0