Jump to content

Playback Reporting


TeamB

Recommended Posts

LongMan

@TeamB,
Thanks for this extremely useful plugin.
On the Active (Devices) tab there is an undefined device which had been added with an API Key. However, there doesn't seems to be any further tracking.
Do you track "users" from API keys?

Edited by LongMan
Link to comment
Share on other sites

TeamB

i don't know, i did not know it was possible to use an api key in a client playback device/app. What client is it?

Link to comment
Share on other sites

TeamB

When the client starts and stops playback do you see the play started and stopped messages in the standard dashboard events?

I am not sure if the client is not reporting in correctly and the session is not correctly created and then logging will not work. I am not sure I can do a lot about this.

 

Link to comment
Share on other sites

pünktchen

As a generated api key isn't tied to any user, i don't think Emby will report any playback progress. It's more like an anonymous session.

Link to comment
Share on other sites

rbjtech
26 minutes ago, pünktchen said:

As a generated api key isn't tied to any user, i don't think Emby will report any playback progress. It's more like an anonymous session.

Agreed - but if you name the API keys in emby - then you'll know exactly what connected as it lists it in the 'Device' column in the Playback Reporting 'Active' screen.   The user is undefined though - so I don't think these can be individually reported on.. ?

Link to comment
Share on other sites

LongMan

Your comments make perfect sense. I asked the Dev if he could add user authentication. Hopefully he does.
Thanks for taking the time to answer and comment.

LongMan

Edited by LongMan
Link to comment
Share on other sites

  • 2 weeks later...
crocobc

Hi there,

 

Thank you for the plugin :)

Is it possible to add users IP Address in "User Playback Summary" ?

If i run "SELECT ROWID, * FROM PlaybackActivity LIMIT 10" i do not see any IP ADDRESS stored in the DB...

Would be very helpful to check if users are sharing login/pass with others.... :)

If this question is not where she meant to be, SORRY ^^

 

Regards

 

Link to comment
Share on other sites

rbjtech
3 hours ago, crocobc said:

Hi there,

 

Thank you for the plugin :)

Is it possible to add users IP Address in "User Playback Summary" ?

If i run "SELECT ROWID, * FROM PlaybackActivity LIMIT 10" i do not see any IP ADDRESS stored in the DB...

Would be very helpful to check if users are sharing login/pass with others.... :)

If this question is not where she meant to be, SORRY ^^

 

Regards

 

That level of data is not held in the Playback Reporting db - try the Activity Log db from the main emby server.   You'll need to take a copy to query it live.

Link to comment
Share on other sites

TeamB
9 hours ago, crocobc said:

Hi there,

 

Thank you for the plugin :)

Is it possible to add users IP Address in "User Playback Summary" ?

If i run "SELECT ROWID, * FROM PlaybackActivity LIMIT 10" i do not see any IP ADDRESS stored in the DB...

Would be very helpful to check if users are sharing login/pass with others.... :)

If this question is not where she meant to be, SORRY ^^

 

Regards

 

i work for a large software company that takes privacy and pii data very very seriously, to the point of having to have privacy audits and reviews of code bases as part of a release cycle of a project. ip addresses always trigger many many discussions and the ultimate result is we can log it if it is actually needed so for this reason i usually am very cautious about logging data like this in personal projects.

however given this data is only viewable by an admin and an admin should already have access to this in the log files then i guess it is ok.

I will look into it.

 

Link to comment
Share on other sites

rbjtech
10 hours ago, TeamB said:

i work for a large software company that takes privacy and pii data very very seriously, to the point of having to have privacy audits and reviews of code bases as part of a release cycle of a project. ip addresses always trigger many many discussions and the ultimate result is we can log it if it is actually needed so for this reason i usually am very cautious about logging data like this in personal projects.

however given this data is only viewable by an admin and an admin should already have access to this in the log files then i guess it is ok.

I will look into it.

 

The source IP is already held in the activity db, along with user, date and time ..

Link to comment
Share on other sites

vaise

This just updated on the beta - to version 2.1.0.1.

Should it be working ?

The only data there is the connected current users.

Nothing else is there.  All historical data is not showing - has it gone ?

Its like it was just reset.

Link to comment
Share on other sites

TeamB

I have added Remote Address to the logged data. This required a schema change and the easiest way was to create a new table. The old data is there in a renamed table that with a few sql commands in the query tab you can migrate it across or you can restore from a backup file.

Link to comment
Share on other sites

vaise

If you can provide the instructions for that old data migration transfer that would be good.

I believe you will be hit with a load of posts like this.

Link to comment
Share on other sites

rbjtech

Restoring the data works ok - but as I only scheduled the task once a week, I have missing data but that's ok.

But agree the update should automatically import the previous data  - especially as you do not get advised it is being removed before the update.

 

Link to comment
Share on other sites

TeamB

it looks like the emby server beta is broken for me at the moment, when i can get it back up I will write a query to do the import.

Link to comment
Share on other sites

rbjtech
14 minutes ago, TeamB said:

it looks like the emby server beta is broken for me at the moment, when i can get it back up I will write a query to do the import.

yep - me too (.30) - non web clients appear to be ok ..

Link to comment
Share on other sites

TeamB

STOP this is destructive, back up your playback reporting data first.
stop emby server and take a copy of the playback_reporting.db DB before you start.

In the query tab run this to get a list of all the tables

SELECT name FROM sqlite_master

It should give you a list like this

PlaybackActivity_20230420_134941
UserList
deep_search
deep_search_data
deep_search_idx
deep_search_content
deep_search_docsize
deep_search_config
PlaybackActivity

the two tables you are interested in are

PlaybackActivity

and any table with the date sting in the end like

PlaybackActivity_20230420_134941

Edit the following query with the name you have in your above results (DONT USE MINE)

INSERT INTO PlaybackActivity
SELECT *, "" AS RemoteAddress FROM PlaybackActivity_<TABLE NAME HERE>
WHERE DateCreated NOT IN (SELECT DateCreated FROM PlaybackActivity)

This will import all the old data into the new table.

 

 

 

Edited by TeamB
  • Like 3
  • Agree 1
  • Thanks 1
Link to comment
Share on other sites

vaise

Yay - Thanks for that - all data is back - just missing the last 12 hours or so.........

 

Link to comment
Share on other sites

vaise

After this little issue, I have now changed my playback reporting backups to happen daily instead of weekly.

Can I ask how I am to restore these however ?

Thanks in advance.

Doh - Ignore - what a knob :

image.png.44544d55ab285434d1beb21d54e068f5.png

Edited by vaise
Link to comment
Share on other sites

TeamB
59 minutes ago, vaise said:

Yay - Thanks for that - all data is back - just missing the last 12 hours or so.........

 

that is weird, it should have been logging all data still and the import/restore just merges the old so into the new table you should still have the most recent items.

can you confirm new data is being logged.

Link to comment
Share on other sites

danmarcoux

@TeamB - this is a great plug in!!  I've only been using it a few days, but it's great for what I'm doing.  

One thing that I'd like to see is the addition of the actual filepath/name being played - if at all possible.   It looks the ItemName field is the name in the Library, but the actual filenames may be slightly different usually due invalid characters (plus no path) (or it could be totally different if it's recognized differently or may not have an episode name (for a TV show), etc..    For my particular use case right now, I don't really need the path, but I can see where it might be useful to some.   My file naming convention is really close to the ItemName field, so the script I'm using works 95% of the time, but knowing the actual filename, well then my script would work 100% of the time!  :)  

So anyways, thanks again, great work!

 

Link to comment
Share on other sites

crocobc
On 4/21/2023 at 3:26 PM, TeamB said:

I have added Remote Address to the logged data. This required a schema change and the easiest way was to create a new table. The old data is there in a renamed table that with a few sql commands in the query tab you can migrate it across or you can restore from a backup file.

This is perfect.

Thank-you for your prompt response 👏

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...