Jump to content

Playback Reporting


TeamB

Recommended Posts

horstepipe
20 hours ago, TeamB said:

Is this in kodi, does the context menu not work?

No, Emby all platforms. Guess it wasn’t designed by that, hopefully the overhaul playlists rewrite comes soon

Link to comment
Share on other sites

Guest worthington_j

Does anybody have a query to view the IP Address a user or device is logging in from?  I want to be able to audit a few logins and make sure they are not coming from strange locations.

Link to comment
Share on other sites

TeamB

Unfortunately the ip is not logged in the playback info table so there is no query in playback reporting you can run to get this info.

Link to comment
Share on other sites

Happy2Play
4 hours ago, worthington_j said:

Does anybody have a query to view the IP Address a user or device is logging in from?  I want to be able to audit a few logins and make sure they are not coming from strange locations.

Pretty sure you would have to look at Emby Activitylog.db.

Link to comment
Share on other sites

seanbuff
1 hour ago, TeamB said:

Unfortunately the ip is not logged in the playback info table so there is no query in playback reporting you can run to get this info.

Really? I find the Active Clients tab stores 'Remote Address' for up to 2 or more days usually. Where is this stored then? Or is it just being read from the DB that Happy mentioned above?

image.png.6e6dc83e6c9e56ae970b2828ddc4b4d4.png

Link to comment
Share on other sites

TeamB

yes this is just comming from the active sessions info, it is not stored my the playback reporting plugin.

it is in the Emby Activitylog.db

  • Thanks 1
Link to comment
Share on other sites

  • 3 weeks later...
bretswinney

image.thumb.png.7618c9e4f089c1b085593626eddab277.png

 

I need help with the query that I can combine old user data with new data @TeamB

Edited by bretswinney
Link to comment
Share on other sites

TeamB

@bretswinney

if these are the same user then you can update the old user ID to the new one using SQL.

First run this with the "Replace UserId with UserName" turn on in the Query tab of the plugin

SELECT UserId, UserId
FROM PlaybackActivity
GROUP BY UserId

It should give yo a list of users with ids, if the user was not sound in the system then it will show you the UserId twice.

You will need to work out which unmapped user IDs belong to which user and then run a query to update all the unmapped user to the new user id.

UPDATE PlaybackActivity SET UserId = '<to UserId>' WHERE UserId = '<from UserId>'

This is a destructive action and you should take a backup of your playback_reporting.db file before running it in case you screw up.

 

Edited by TeamB
Link to comment
Share on other sites

TeamB

what is the result of this query

SELECT UserId, UserId
FROM PlaybackActivity
GROUP BY UserId

does it show the user twice, post the result

Link to comment
Share on other sites

Happy2Play

Wouldn't enabling "Replace UserId with UserName" on the query screen help with the duplicates?

Link to comment
Share on other sites

Happy2Play

Ah looking at the headers you already had it enabled in the first image, but UserName is not shown except on those three.  And there is something wrong with KK as it has no UserID.

Not sure how you will be able to link the unknown user to known users besides guess work.  Dev might have some ideas.

How many users do you have?

Link to comment
Share on other sites

TeamB
1 hour ago, bretswinney said:

image.png.c88e3c6bcd89530846f691082a2a6d31.png

I think you got the UPDATE query wrong 🙂

You dont want to replace the UserId with the name, you want to replace it with the new UserId, you are swapping out the old UserId for the new one.

Example:

Lets say old user id 8d17115859ec48cf9b150d8e1611e011 is for JP Luna that has current UserId of 9811b261884b4f32b892d6d3d14ec170

The query would be

UPDATE PlaybackActivity SET UserId = '9811b261884b4f32b892d6d3d14ec170' WHERE UserId = '8d17115859ec48cf9b150d8e1611e011'

you are updating the old userid with the new one. The above ID could be wrong as I had to type them in manually.

 

Edited by TeamB
Link to comment
Share on other sites

TeamB
Just now, bretswinney said:

image.thumb.png.20b81b56c7236e29237b2236b5697b4e.png

 

Now it's doing this

yeah you probably broke it lol

You kept a backup of the playback_repoting.db file correct? shut down the server roll back the changes. Start again, see the above example query, note the iD might not be correct.

Link to comment
Share on other sites

bretswinney

I have just started using Synoloogy & don't know how to change .db file.  Anyone know how to?

Link to comment
Share on other sites

Happy2Play
15 minutes ago, bretswinney said:

I have just started using Synoloogy & don't know how to change .db file.  Anyone know how to?

Not a Synology user but you would have to ssh to the db location.

Did you make a backup of this database before making changes?

Do you have backups setup in the plugin settings?

Link to comment
Share on other sites

bretswinney
17 minutes ago, Happy2Play said:

Not a Synology user but you would have to ssh to the db location.

Did you make a backup of this database before making changes? I do from my old mac server

Do you have backups setup in the plugin settings? yes

 

Link to comment
Share on other sites

Happy2Play
9 minutes ago, bretswinney said:

Do you have backups setup in the plugin settings? yes

You should be able to load a backup if the current db is corrupt.  But ideally you should ensure you have a backup of the db before making any changes.

12 minutes ago, bretswinney said:

Did you make a backup of this database before making changes? I do from my old mac server

No sure how reliable this will be on a new server.  I am guessing all the userids changed when you switched from Mac to Synology?

Link to comment
Share on other sites

bretswinney
2 minutes ago, Happy2Play said:

You should be able to load a backup if the current db is corrupt.  But ideally you should ensure you have a backup of the db before making any changes.

No sure how reliable this will be on a new server.  I am guessing all the userids changed when you switched from Mac to Synology? yes

 

Link to comment
Share on other sites

Happy2Play
4 minutes ago, bretswinney said:

I am guessing all the userids changed when you switched from Mac to Synology? yes

Did you use the server configuration plugin to restore users on the new server or just manually add them?

But the difficulty will be aligned userids.

Is the Mac server still functional?  If so you could run the query on it to get pervious username/userids.

Link to comment
Share on other sites

bretswinney

Yeah db is now messed up & I can't get in it to fix it.  The one thing I don't like about the synology server.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...