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

user.php - Enhancement to Stats #10

Closed
jsgiacomi opened this issue Oct 3, 2013 · 20 comments
Closed

user.php - Enhancement to Stats #10

jsgiacomi opened this issue Oct 3, 2013 · 20 comments
Milestone

Comments

@jsgiacomi
Copy link

I like the --stats that plex watch outputs. I was thinking you could add the following to the user page so when you bring up a user it displays the following:

HH:MM watched in the last 24 hours (1 day)
HH:MM watched in the last week
HH:MM watched in the last month
HH:MM watched All Time

Good stats to have handy when assessing usage....should be pretty easy to add to the top. Let me know what you think.

@ecleese
Copy link
Owner

ecleese commented Oct 3, 2013

I wanted to add some sort of overview to the top of the user page. Having general stats there sounds great and they should be pretty easy to implement.

@ecleese
Copy link
Owner

ecleese commented Oct 5, 2013

This is now available in the dev branch. Currently I am displaying both # of plays and time (in minutes). I'm sure I could convert to days, hours, minutes etc if it makes more sense to do so.

@ecleese
Copy link
Owner

ecleese commented Oct 6, 2013

Decided total times look better in hours, minutes. New commit available. I will most likely extend code at some point to automatically display days, hours when above "0"

@jsgiacomi
Copy link
Author

This is very nice and everything looks accurate. This feature brings to the forefront the need to break out User and Device combos in some way. I got a few ideas on that front that I will add to that specific issue (Issue #7)

@jsgiacomi
Copy link
Author

Does the Play Count account for the starts and stops of the same movie? In other words a start and stop accounts for 2 lines in the History page. Does that count as 2 plays?

Thanks,

@ecleese
Copy link
Owner

ecleese commented Oct 6, 2013

Yes, currently the play count is every row inside the database for that user since they are technically playing something. When we add grouping to the mix this value will change based on the parameters ljunkie sets for grouping.

@jsgiacomi
Copy link
Author

Aren't there already grouping parameters? My log from the terminal shows one World War Z play, as opposed to the history table.

screen shot 2013-10-06 at 9 36 29 am

screen shot 2013-10-06 at 9 39 25 am

@ecleese
Copy link
Owner

ecleese commented Oct 6, 2013

ljunkie currently does the grouping inside of plexWatch.pl as a "hack" of sorts.This data is not available in the current database.

From our discussions so far it sounds as though the grouping code is pretty complex and would take quite some time to try and reproduce in PHP or Javascript. Our plan is most likely to create and maintain two different tables inside of the db that plexWatch.pl will write to. The first being the current table and the second one will be a grouped results table.

On the UI side we could either create a simple "grouping" toggle button or create a settings page which could offer the user a "grouping options" section for each available item separately (global history, user stats, charts, etc). I personally like global history as a sort of log detailing every start, pause and stop. Others may not so it would be a nice option to provide the user to set for themselves.

@jsgiacomi
Copy link
Author

Not sure what is going on here, let me know what info you need. It may be due to this user currently streaming?

screen shot 2013-10-09 at 9 43 54 pm

@ecleese
Copy link
Owner

ecleese commented Oct 10, 2013

Yeah that's because of a current stream in progress. An in-progress stream has no "stopped" time field entry so a proper calculation cannot be completed. I've made some changes already to hide the time when an active stream is in progress. This will be part of the next commit.

@vwieczorek
Copy link

Also, would it be possible to display user IP address information on this page? My primary goal with this would be to try and track/detect the sharing of credentials. I know is this is challenging from a mobile perspective, but would still be nice to display a list of recent IPs or "last seen from" kind of stat.

@ecleese
Copy link
Owner

ecleese commented Oct 11, 2013

The tab next to Profile labeled "History" displays a watching history table for that user complete with ip address information for every stream that plexWatch logs.

Did you want something more general on the profile table just stating "Last seen @ IP address: 0.0.0.0"?

@jsgiacomi
Copy link
Author

Actually what would be great is a list of all IPs that user has connected with sorted by the date that IP was last used....and, if it's not too much, a geolocation stamp of that IP at that time. I can post a mock up later.

@jsgiacomi
Copy link
Author

Again this really needs to be separated out by the user/device groupings.

@vwieczorek
Copy link

Yes, exactly what powertowerpro said, "...a list of all IPs that user has connected with sorted by the date that IP was last used". I would also prefer it to be on a single screen for all user, rather than separate for each user. But again, just my preference. Geolocation would be a nice bonus.

@ecleese
Copy link
Owner

ecleese commented Oct 11, 2013

Good ideas guys, a lot for me to think about.

The geolocation idea... were you thinking it would be a url link to say a point on google maps based on approximated ip address coordinates?

I'm always conscience of not cluttering up the UI so I'm not sure how I feel yet about all that information on the users page. I will consider it but will probably break it down on user.php first.

The user/device grouping is on hold until ljunkie provides me a grouped database table.

@jsgiacomi
Copy link
Author

I would put the IP stuff in the HISTORY sub-page under Users (not the profile page). I am very UI conscience as well and I think we can make this look nice and clean. One of the main reason for requesting these sorts of logs on the plex forums was to make sure people were not sharing accounts so this IP info is more important than some may realize.

As far as Geolocation, a simple state and city would do, with the ability to click it and have a google maps page come up. Oh and if we could have a count of plays by IP address that would be helpful as well.

A quick mock up:
mockup2

@ecleese
Copy link
Owner

ecleese commented Oct 15, 2013

Just about done adding IP history with geo tagging and google map links. I'm not so sure I can pull off adding the platform column since the query includes GROUP BY but otherwise we're in good shape. In your image what was the # Count column to be? Number of plays from that IP?

user-history-ip_history

@jsgiacomi
Copy link
Author

Exactly - # of plays by that IP.

As for platfom, thats an important field here. There should be a way to (thinking back to my sql days) count the unique platforms listed for each IP and then output the most common one. I know thats not easy, but I have done it in the past. Appreciate all your hard work on this.

@ecleese
Copy link
Owner

ecleese commented Oct 26, 2013

These enhancements are now available in the latest dev version.

@ecleese ecleese closed this as completed Oct 26, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants