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

[database] - add setting for hiding watched movies/episodes in recently added lists #5747

Closed
wants to merge 2 commits into from

Conversation

Memphiz
Copy link
Member

@Memphiz Memphiz commented Nov 18, 2014

This is the c++ alternative to #5745

Not sure if i got the intention right. Not even sure why i joined that party tbh.

This basically adds 2 settings "Hide watched movies in recently added list." and "Hide watched episodes in recently added list." to the videos->Library section which does exactly that (and yes - this setting influences all recently added lists for movies/episodes - not only the ones on the home screen).

@MartijnKaijser let me know if this hits the feature request (i was kinda sick to read it completely and have the feeling that the bikeshedding didn't happen yet - so lets start it).

I* as its a feature... (this is btw not even compile tested yet ...)

@MartijnKaijser
Copy link
Member

yep look like this nailed it what user requests intended.
here's the bikeshed part (well option open for discussion) ;)

  • Either split or single option to hide them (you've now done split)
  • Should they only be hidden on homescreen or in recently added view as well (atm it influences all)

@Memphiz
Copy link
Member Author

Memphiz commented Nov 18, 2014

You nailed the bikeshed points (+ the translation of course :D)

@da-anda
Copy link
Member

da-anda commented Nov 18, 2014

yay, bikeshedding. As I prefer blue it would be nice to add a contextual comment to all new labels, not just the settings description. Thanks.

Let me add that if the setting "hide watched" in the sideblade of Confluence is enabled for the movie library, this already affects the "recently added" library node. With having this overruled by the new global setting users might get confused that the sideblade settings no longer has an effect (untested - but as I don't see this condition treated in your code changes I assume that's the case). IMO it might be sufficient to respect the library setting also on home screen widget.

@piejanssens
Copy link

Not ideal and restricts recently added movies view to unwatched only:
On the homescreen "the widgets" should be able to display the latest/unwatched items, but if you press down on 'movies' and choose 'recently added' you want to see everything or hide watched using the view filter "hide watched". IMO the library setting should not affect the home screen widgets, because when you setup recently unwatched items on the homescreen for fast access to the latest content, you'd still want to be able to view all your latest items in the library (and use the view menu to control watched/unwatched).

I see that GetRecentlyAddedMoviesNav is being called to set those home window properties for LatestMovie. GetRecentlyAddedMoviesNav is probably separately called for the movie list view
Thus, adding an argument/parameter based on the skin settings to GetRecentlyAddedMoviesNav solves the issue here. I guess the directory view is using this code? https://github.com/xbmc/xbmc/blob/2228e7f209fbf244bb0f9da970903016395043f2/xbmc/filesystem/VideoDatabaseDirectory/DirectoryNodeRecentlyAddedMovies.cpp

So the call for the window properties to GetRecentlyAddedMoviesNav can pass a parameter based on the system settings (e.g. "unwatchedOnly = true), whereas the call to GetRecentlyAddedMoviesNav for the recently added directory view can always pass "unwatchedOnly = false".

@Montellese
Copy link
Member

Haven't looked at the code yet but since it only touches CVideoDatabase the concerns from @da-anda that new "hide watched" flags could influence the recently added node list is invalid for two reasons:

  • The "Recently Added Foo" nodes in the video library don't call CVideoDatabase::GetRecentlyAddedFoo()
  • The "Hide watched" flag in the library views is manually applied to the list of retrieved items and not to the database query.

@Memphiz
Copy link
Member Author

Memphiz commented Nov 18, 2014

@Montellese but CDirectoryNodeRecentlyAddedMovies::GetContent(CFileItemList& items) calls it (is this not the thing we talk about?)

@Memphiz
Copy link
Member Author

Memphiz commented Nov 18, 2014

This would also influence the list returned to json-rpc (which is bad imo) - so i go for a different approach which only influences the recentlyaddedjob

@Memphiz
Copy link
Member Author

Memphiz commented Nov 18, 2014

Updated. I tend to also merge the 2 settings - at least if no one comes up with a valid reason why someone would like to see the already atched recently added episodes but wants to hide those from the movie list...

@piejanssens
Copy link

Looks good. Don't forget about albums (same logic).
Merging the settings makes sense to me.

@Montellese
Copy link
Member

@Memphiz: You're right. I thought we replaced the "Recently Added Foo" nodes with smartplaylist-based filter nodes but they still use videodb://recentlyaddedfoo/ so they end up going through CVideoDatabase::GetRecentlyAddedFoo(). IIRC we changed it once but had some issues so we changed it back (which is what I forgot).

@Montellese
Copy link
Member

Code changes look good but the settings name/description doesn't make it obvious that we are only talking about the recently added list on the home screen.

@Memphiz
Copy link
Member Author

Memphiz commented Nov 18, 2014

The stupid thing is that enabling the recently added widgets is a skin setting but this one needs to be in core. Its not really intuitive from a user pov.

@Memphiz
Copy link
Member Author

Memphiz commented Nov 18, 2014

playcount is not available in the musicdatabase / albumsview ... @Montellese this would need what? (i guess version bump + migration path or so?)

@Memphiz
Copy link
Member Author

Memphiz commented Nov 18, 2014

updated:

  1. merged the settings
  2. added musicvideos
  3. changed the string a bit.

as said albums is a pita @piejanssens wanna take this over? ^^

@Montellese
Copy link
Member

Yeah I also dislike the fact that this setting only makes sense if the skin uses the builtin recently added functionality. If a skin doesn't use it or relies on some other way to get the items the setting is useless and confusing.

@MilhouseVH
Copy link
Contributor

Build failure on OpenELEC/Pi:

RecentlyAddedJob.cpp: In static member function 'static bool CRecentlyAddedJob::UpdateVideo()':
RecentlyAddedJob.cpp:60:22: error: 'CSettings' has not been declared
   bool hideWatched = CSettings::Get().GetBool("videolibrary.hiderecentlywatchedvideos");
                      ^
In file included from /home/neil/projects/OpenELEC.tv/build.OpenELEC-RPi.arm-devel/kodi-14-88a9a44/xbmc/guilib/GUIControl.h:30:0,
                 from /home/neil/projects/OpenELEC.tv/build.OpenELEC-RPi.arm-devel/kodi-14-88a9a44/xbmc/guilib/GUIControlGroup.h:28,
                 from /home/neil/projects/OpenELEC.tv/build.OpenELEC-RPi.arm-devel/kodi-14-88a9a44/xbmc/guilib/GUIWindow.h:31,
                 from RecentlyAddedJob.cpp:26:
/home/neil/projects/OpenELEC.tv/build.OpenELEC-RPi.arm-devel/kodi-14-88a9a44/xbmc/guilib/GraphicContext.h: At global scope:
/home/neil/projects/OpenELEC.tv/build.OpenELEC-RPi.arm-devel/kodi-14-88a9a44/xbmc/guilib/GraphicContext.h:297:150: warning: 'g_graphicsContext' defined but not used [-Wunused-variable]
 XBMC_GLOBAL(CGraphicContext,g_graphicsContext);
                                                                                                                                                      ^
/home/neil/projects/OpenELEC.tv/build.OpenELEC-RPi.arm-devel/kodi-14-88a9a44/Makefile.include:93: recipe for target 'RecentlyAddedJob.o' failed
make[2]: *** [RecentlyAddedJob.o] Error 1
make[2]: *** Waiting for unfinished jobs....

Can I ask a really dumb question - assuming this only affects the widgets on the Home screen, why isn't this being handled by the skin.widgets addon itself?

@Montellese
Copy link
Member

@MilhouseVH: Because we are talking about confluence which doesn't use the skin.widgets addon but uses the builtin RecentlyAdded skin labels.

@MartijnKaijser
Copy link
Member

there are two options. do it proper in core like this PR or rip it completely out of core and put it in a "team" maintained addon (skin.widgets wouldn't be my first choice). Using an Add-on is way way slower due to python+json-rpc.

@MilhouseVH
Copy link
Contributor

Oh wow, I thought it did! Told you it was a dumb question :)

@Memphiz
Copy link
Member Author

Memphiz commented Nov 18, 2014

compilation fixed

@MilhouseVH
Copy link
Contributor

Ok, have tested this and it's working in reverse - the Homescreen is only showing watched items!

The "Recently Added" view is showing all items, so that's good.

#. Label of setting "Videos -> Library -> Hide watched videos in recently added list (home screen)."
#: system/settings/settings.xml
msgctxt "#20470"
msgid "Hide watched videos in recently added list (home screen)."

This comment was marked as spam.

@Montellese
Copy link
Member

@MilhouseVH: Yup the WHERE condition is wrong and should be playcount <= 0.

Are we aiming to get this in for Helix? Because I'm uncomfortable with the additional setting as it might be confusing. Another approach that could get rid of the whole recently added in core (if it's fast enough) would be to use the <content> tag introduced by @jmarshallnz. That way it would be in complete control of the skin.

@MilhouseVH
Copy link
Contributor

added musicvideos

It's a bit weird having a setting in Video Library also affect how recently added Music is shown - would it not be better/more logical to have a separate Music Library setting?

Edit: Oh hold on - this is musicvideos not Music? Hmmm.

@Montellese
Copy link
Member

Music videos are part of the video library so that's correct.

@piejanssens
Copy link

I think we should move the settings over to the skin. We can add it to the default skins now and skinners will update their skin whenever they want to benefit from the increased performance. A skin without homescreen tiles doesn't have to use it.

Update: as it's currently implemented by Memphiz it looks solid: good description saying that it depends on the skin that is being used. Thus no room for surprises.

@piejanssens
Copy link

Oh I didn't know there was no play count on album level. I see that the widgets addon is also just returning all recently added. We could either apply the same logic using the param played/unplayed in GetRecentlyAddedAlbums and check that playcount of all songs belonging to that album must be 0 if unplayed param is used or change the core player and set/change a playCount on album level which is going to open another discussion (playCount +1 when first song is played/90% is played/all songs played).

BUT... Personally I don't care about unplayed recent albums on the homescreen because we use music in a different way. I don't want to watch a movie two times in a row or in the same week, but with music it's fine and so in that sense it might even be desired not to filter played albums from the homescreen...

@Memphiz
Copy link
Member Author

Memphiz commented Nov 19, 2014

Yep exactly. This makes no sense for music at all ...

@Memphiz
Copy link
Member Author

Memphiz commented Nov 20, 2014

@piejanssens i got an email with a comment from you but don't see it here strange

@piejanssens
Copy link

Yeah I removed it out of humongous shame. Couldn't see the effect after compiling, turned out I wasn't using the correct branch from your fork.. :)

Meanwhile compiled and tested -- WORKS GREAT

Thanks man.

@MilhouseVH
Copy link
Contributor

Could this be rebased (I'd like to use it in an x86 build), perhaps even merged?

Popcornmix has a version of this PR in his RPi newclock4 branch which I've been including in my test builds for quite a while now, and this feature works very well.

@MilhouseVH
Copy link
Contributor

Time to push the button on this one? It works great.

@MilhouseVH
Copy link
Contributor

What's going on with this PR? Close it or use it?

movies/episodes/musicvideos in the recently added lists of the home screen
movies/episodes/musicvideos in
recently added job (should influence homescreen of skins only)
@Memphiz
Copy link
Member Author

Memphiz commented May 19, 2015

Rebased - well this is as good as it gets from my seide. @Montellese & @MartijnKaijser for decision.

@Montellese
Copy link
Member

The code changes look ok. But my concerns regarding adding a setting which only applies depending on how skins are written are still there.

@Memphiz
Copy link
Member Author

Memphiz commented May 21, 2015

mine too - but i don't see a way to make it generic and skin independend. Skins can always do stuff which is not ment to be like that though.

@Hitcher
Copy link
Contributor

Hitcher commented May 21, 2015

In my humble opinion this should be a change to Confluence only otherwise you'll end up with people reporting that it doesn't work when using other skins. As far as I'm aware there aren't any other Kodi settings that are skin specific like this. I also thought there was discussion some time ago about doing away with the home window info labels.
The easiest way to do this in Confluence would be to switch to using smart playlists to fill these fields and add them to the skin settings.

@ronie
Copy link
Member

ronie commented May 21, 2015

very little skins still use the built-in 'recently added job' to present recently added items on their homescreen. most have switched to an addon or other methods to provide that info.

it's not worth to add a setting for it imo.

@Hitcher
Copy link
Contributor

Hitcher commented May 21, 2015

@ronie Are you replying to me or the thread?

@Memphiz
Copy link
Member Author

Memphiz commented May 21, 2015

+1 for handling it somewhere else tbh. The builtin is more used for remote controls i guess who also could do this kind of filtering on their own.

@ronie
Copy link
Member

ronie commented May 21, 2015

@ronie Are you replying to me or the thread?

just my thoughts in general.
PR can be closed as far as i'm concerned.

@Memphiz Memphiz closed this May 21, 2015
@mikatrash
Copy link

The PR is closed but if the appropriate place to implement this feature is in Confluence, was there a feature request created to have a chance to have this feature available in the future ?

@razzeee
Copy link
Member

razzeee commented May 5, 2016

@ronie has this changed now? does estuary use the job and does this make sense again all of a sudden?

@ronie
Copy link
Member

ronie commented May 5, 2016

3 x no ;-)

@foss-
Copy link

foss- commented May 6, 2016

Pardon me for not reading comment backlog of 2 years, but why is this not a feature that get's implemented in estuary?

@NedScott
Copy link
Contributor

NedScott commented May 8, 2016

That's a question best asked on the Kodi forums because it will, no doubt, result in too many replies on github.

@Memphiz Memphiz deleted the hiderecentlywatched branch May 22, 2016 12:47
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

Successfully merging this pull request may close these issues.

None yet