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

[GSoC] Advanced Library Filtering #1399

Merged
merged 29 commits into from
Oct 9, 2012

Conversation

Montellese
Copy link
Member

Well this is it, the last PR from my GSoC 2012 work which will add the Advanced Library Filtering dialog to movie, tvshow, epsidode, musicvideo, artist, album and song views.

For team members: It's still with the "crappy" GUI integration. I've implemented the request to show the number of possible options for filters like genre, actors, directors etc next to the filter name so if there are 25 genres available to choose from for the current list of movies it will show "Genre [25]".

@arnova
Copy link
Member

arnova commented Sep 10, 2012

I've been waiting for this :-)

@ronie
Copy link
Member

ronie commented Sep 11, 2012

a few oddities i came across after using it for some time:

  • i have a hard time figuring out how to clear the filtered list and get a listing of all my movies back.
    i would expect hitting 'clear' and 'ok' in the dialog would do this, but it doesn't have any effect.
  • navigation is somewhat borked. when a filtered list is in effect, hitting back on my keyboard to navigate back to the home screen, we take this path:
    filtered list > root of movie lib > filtered list > root of video lib > home
  • slight skin breakage: the old filter button (id=19) doesn't show up anymore in other skins.

@Montellese
Copy link
Member Author

@ronie: Thanks a lot for taking the time to test this. You're the first person to provide any real feedback and I'm grateful.

  • Yup that seems to be borked because of some other changes I made in master to smartplaylists. I just fixed it locally. Will push the fix soon.
  • Hm I have discussed this with jmarshall and we decided that hitting back on a filtered list should remove the filter. Here is how it works for me when using the Backspace key: filtered list -> unfiltered list -> home screen. And when using the ESC key: filtered list -> home screen
  • That's because it isn't supposed to. XBMC decides for each view whether to show the old filter button or the advanced filter button so it's not really a breakage. I added the advanced filtering as a new button because it can be represented with an additional checkbox which indicates whether the current list is filtered or not. So skinners will have to add the additional button (id = 20) for the advanced filtering and XBMC will take care of which one to show and which one to hide. I don't really know anything about skinning so if that's not acceptable let me know.

@Montellese
Copy link
Member Author

Damn sent to early. Now I was able to reproduce your description of the navigation. If you filter a list, then press ESC to get back to the home screen and then go back into the list it goes like this:
filtered list -> ESC -> home screen -> Enter -> filtered list -> Back -> root of movie lib -> Back -> filtered list -> Back -> root of video lib -> Back -> Home

Very odd. I'll have to look into it. What would you expect to happen with the filtered list when you hit ESC? Should the filter still be applied next time you enter the same list or should it be discareded and show the full list again? I guess these kind of behaviours need to be discussed a bit more.

@Montellese
Copy link
Member Author

I pushed an update which fixes the "Clear" button not working and which also fixes the odd navigation issua ronie pointed out.

@Montellese
Copy link
Member Author

After talking to @ronie and @cptspiff about how to integrate the old filtering and the advanced filtering into skins we realized that we can't get away with using the same button for both the old and the advanced filtering. On request of cptspiff I've added 3 new info booleans on Container level: Container.CanFilter, Container.CanFilterAdvanced and Container.Filtered which can be used by skins in visibility conditions for the two filter buttons. Furthermore the advanced filtering functionality is no longer tied to a specific button/control ID but can be triggered using the new "filter" action (which will either bring up the dialog for the old or the advanced filtering).

@Montellese
Copy link
Member Author

And yet another update. I've known that staying on the currently selected item when changing a filter wasn't working because when changing the filter the path of every item changes (it always contains the current filter) but we use the path to identify the currently selected item. I added some code that should take care of this problem so when you filter (or clear a filter) it should just stay on the same item (unless the item doesn't match the filter anymore).

@Montellese
Copy link
Member Author

@jmarshallnz Would be grateful if you could take a look at the code as you were/are the mentor of my project and let me know if it's ok for October or not (obviously after a rebase).

@ghost ghost assigned jmarshallnz Sep 19, 2012
@jmarshallnz
Copy link
Contributor

Assigned to me

@Montellese
Copy link
Member Author

Rebased onto latest master.

@Montellese
Copy link
Member Author

Once again rebased. Still waiting on final review and/or "good to go".


// don't create the filter if there's no real range
if (min == max)
break;

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

@Montellese
Copy link
Member Author

OK I have squashed the fix commits into the original ones (except for the ACTION_SELECT_ITEM one) and rebased onto latest master.

There are two things left to do:

  1. Decide how to do the navigation between the two sliders/range selectors in the CGUISliderControl. The two options right now are either using Select/Enter/OK to switch between the two sliders which has the advantage of being able to get to the next/previous filter options without any extra clicks but requires an additional button, or to use the move up/down button to switch between the two sliders which has the disadvantage of requiring an extra button press to get to the next/previous filter option but doesn't need any extra buttons.
  2. Update Xcode project files for OSX.

Any opinions on what is more intuitive for the navigation within the slider/range selector? My initial implementation followed the second option i.e. doing everything with "move up/down" keys and I've used that for a while now so I can't really judge if using Select/Enter/OK is more intuitive/easier to use.

@da-anda
Copy link
Member

da-anda commented Oct 3, 2012

as mentioned on IRC I gave the navigation/handling of sliders a thought and have another proposal on how navigating them could work. It's just a proposal and I'm also fine with the "press select to switch between controls" thingy.

Idea 1:

This one will only work if we would add checkboxes to enable/disable filters. Disabled filters could be greyed out and their options probably also hidden until they are enabled. Given this, up/down will by default scroll through the list as they always do. Once a slider filter is enabled, left/right can be used to move between checkbox and the two slider handles. When focused on a slider handle, up/down can be used to indrease/decrease the value (move the slider). To scroll up/down in the list again one has to focus the checkbox (unfocus the slider handles).

Idea 2:

This also works without the additional checkboxes. up/down always navigate the list. When focusing a slider item, the first handle is focused. Switching between the handles can be done with left/right, just as expected. To move a handle it has to be "activated" by pressing enter (status needs to be visually indicated) . Once "activated" left/right can be used to move the slider - up/down will still navigate the list. To "deactivate" and switch to the other handle one has to either press select or back and can then switch between the handles with left/right again. The benefit of this behavior would be that it's almost like draging with the mouse - so click'n'drag (select = mouse-down, left/right = drag, second select/back = mouse up).

Are just proposals/ideas - nothing more. Don't want to block this PR.

@jmarshallnz
Copy link
Contributor

I wonder whether up/down to move a left/right slider is counter-intuitive? I think it would be OK if there was a clear "click to activate" where the slider nib very clearly came into focus. However, it's not obvious to me that a further click would deactivate the slider, whilst still keeping it in effect (I might be tempted to hit BACK instead?)

The click technique seemed natural enough when I first tried the UI, but as pointed out above - once you know, you know :)

@ronie
Copy link
Member

ronie commented Oct 6, 2012

this is gonna be a long shot....
if we want an intuitive way to control the range slider, without any navigation issues, it should be done like this:
http://i687.photobucket.com/albums/vv237/roniez/tmp/slider.png

that being said, i'm fine with the current implementation as well.

@MartijnKaijser
Copy link
Member

@ronie
looks good

…list

There are three new Container info booleans for skins: Container.CanFilter,
Container.CanFilterAdvanced and Container.Filtered where CanFilter and
CanFilterAdvanced are mutually exclusive. These can be used for visibility
conditions of the existing "Filter" button and a new "Filter" button for
advanced filtering.
Furthermore a new action "filter" is available which will open the respective
filter dialog depending on whether the container/list supports simple or
advanced filtering.
@Montellese
Copy link
Member Author

OK jmarshall and I have decided that we will use the Select/Enter/OK button to switch between the range sliders for now as it requires less special handling. I have squashed that commit into the CGUISliderControl commit and everything should be merge-ready now. Anything else to squash down?

{
hasNewItems = false;

CFileItemList resultItems;

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

@ghost ghost assigned Montellese Oct 9, 2012
Montellese added a commit that referenced this pull request Oct 9, 2012
@Montellese Montellese merged commit 39ab944 into xbmc:master Oct 9, 2012
@MartijnKaijser
Copy link
Member

Currently de slider for addon settings is broken
http://imageshack.us/a/img823/3310/screenshot004hh.png

@Montellese
Copy link
Member Author

Looks alright to me :-P Thanks for the report, I'll look into it.

@Montellese
Copy link
Member Author

I checked all the addons I have installed (very few) and I only found two settings using a slider, both from screensavers (with a percentage value) and they work perfectly fine for me. Could you provide me with whatever addon shows that problem for you?

@Voyager1
Copy link

something's wrong with this. When navigating to "recently added" the list first loads with the recently added items. The GetFilteredItems then overrides that by loading the complete movie list. Funny thing is that the real "recent" items get their thumb loaded - the others stay blank. The issue seems to be that the XPlaylist is not taking into account that this was just the "recently added" list, but thinks it's the entire movie list.

@Montellese
Copy link
Member Author

Yeah I'm aware of the issue and have already fixed it locally. Still testing if there's any other odd behaviour because of the fix.

@Voyager1
Copy link

Montellese, there's still something funky going on with the set thumbs. Especially, when you enter a set, not all thumbs get loaded, and then get back out of it, the set thumb is gone. So are the other sets... When you move the cursor, thumbs appear one at a time.

@Voyager1
Copy link

Montellese, another issue: when you change the setting "group movies in sets", it only takes effect on the movie list when restarting xbmc. That used to work before.

@Montellese
Copy link
Member Author

I have to look onto the thumb loading (again).
Concerning toggling Group in Movie sets this has been a bug in mainline ever since that feature has been added but I only noticed two weeks ago. Tbh I forgot about it. The problem is that we don't reset the cache for movie lists when that setting is toggled.

@Montellese
Copy link
Member Author

Fixed the artwork problem (see cadede2) although it had nothing to do with this PR but with @jmarshallnz artwork changes. Don't go blaming everything on me :-P

@Montellese
Copy link
Member Author

And 05593e4 takes care of the issue when changing the "Group movies in sets" setting.

@Voyager1
Copy link

thanks so much for both fixes and apologies for the 'blame' - I was so focused on testing the filtering update that I forgot about the other major changes that had gone in.

@Montellese Montellese deleted the gsoc_advanced_filter branch April 4, 2014 18:00
tru pushed a commit to plexinc/plex-home-theater-public that referenced this pull request Nov 27, 2014
This caused some restricted connections to be dropped since a
connection could have both CONNECTION_MYPLEX and CONNECTION_DISCOVERED
set. Now we just check if we have token for the connection instead, it
should give the same result, hiding discovered servers that doesn’t
have a mapping.

Related to xbmc#1399
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Feature non-breaking change which adds functionality
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

8 participants