Jump to content

Playback Reporting


TeamB

Recommended Posts

TeamB
7 hours ago, danmarcoux said:

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!  :)  

if you are running an external script you can use the item id to query the emby api for the item details that would include the path and filename.

The API you can use is

http://<address:port>/emby/Items/?ids=<ids of item>&fields=path&api_key=<your api key>

<address:port> = your abbress and port for your Emby server

<ids of items> = this is a single ID or a list of ids comma seperated

<your api key> = is the server API key you generate in the Emby server Api Key settings

you will get back some JSON you can parse to get your item details, the path is in there.

 

Edited by TeamB
Link to comment
Share on other sites

pwhodges
On 22/04/2023 at 01:59, TeamB said:

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.

After the import mine has all my data up to the present without any missing gap.

Thanks for the instructions.

Paul

Link to comment
Share on other sites

jaycedk

Guess this is the new thing 😁

Guess it only applyes from app update.

image.png.05621745def02c0a655a436e2bb6f765.png

Edited by jaycedk
Link to comment
Share on other sites

TeamB
2 hours ago, jaycedk said:

Guess this is the new thing 😁

Guess it only applyes from app update.

if you are referring to the remote address then yes it is new and if you restore from backup it will be undefined for old data as it was not logged until the latest version.

Link to comment
Share on other sites

Q-Droid

This plugin just updated for me on Emby stable to v2.0.0.3 but there was no data after the update. Was this supposed to happen?

Since the query returned no rows I just restored from from backup. I may have jumped the gun...

Link to comment
Share on other sites

TeamB
4 hours ago, Q-Droid said:

This plugin just updated for me on Emby stable to v2.0.0.3 but there was no data after the update. Was this supposed to happen?

Since the query returned no rows I just restored from from backup. I may have jumped the gun...

yes it was expected, either restore from backup or there is an sql command you can run (see a few posts back) to import all the old data

Link to comment
Share on other sites

Q-Droid
7 hours ago, TeamB said:

yes it was expected, either restore from backup or there is an sql command you can run (see a few posts back) to import all the old data

That's what I ended up doing and also found the renamed backup table. They were both the same so the restore from backup was enough. I just wasn't expecting the plugin update on Emby stable to not migrate the data and I suspect you're going to have some fresh posts about that. 😉

 

Edited by Q-Droid
Link to comment
Share on other sites

fahad92
On 4/21/2023 at 4:20 PM, TeamB said:

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.

 

 

 

 

Hi , thank you for this amazing plugin.

I don't have a backup and wasn't aware that I will lose all my data and I'm not sure what I should do to get my data back,  your steps above is obviously not nooby friendly.

What I should from this screenshot. 

Well like what Michael scott said: explain this like I'm five.

Joke aside this is something up to you to do and in all cases love your work.

 

 

 

 

Screenshot_20230426_144918_Samsung Internet.jpg

Link to comment
Share on other sites

TeamB

@fahad92

you are almost there, just run this now in the query tab like you did for the first query

INSERT INTO PlaybackActivity
SELECT *, "" AS RemoteAddress FROM PlaybackActivity_20230424_160540
WHERE DateCreated NOT IN (SELECT DateCreated FROM PlaybackActivity)
Edited by TeamB
  • Thanks 1
Link to comment
Share on other sites

dual-o

Hello,

my report DB was gone too after autoupdate to 2.0.0.3. I delete the DB in the filesystem and restart emby-server. The restore from backup doesn't work for me 😕
Is there a process to check if the restore is complete. My Backup File is 13M.

Link to comment
Share on other sites

TeamB
32 minutes ago, dual-o said:

I delete the DB in the filesystem and restart emby-server.

umm why did you do that?

Link to comment
Share on other sites

fahad92
9 hours ago, TeamB said:

@fahad92

you are almost there, just run this now in the query tab like you did for the first query

INSERT INTO PlaybackActivity
SELECT *, "" AS RemoteAddress FROM PlaybackActivity_20230424_160540
WHERE DateCreated NOT IN (SELECT DateCreated FROM PlaybackActivity)

Thank you so much for your help

Edited by fahad92
Link to comment
Share on other sites

dual-o
8 hours ago, TeamB said:

umm why did you do that?

I understand that the DB must be started from scratch cause of the new schema. Anyway I have a backup of my DB File, after the update and a backup tsv from Monday. How can I restore it?

 

Thanks in advance 

Edited by dual-o
Link to comment
Share on other sites

TeamB
29 minutes ago, dual-o said:

I understand that the DB must be started from scratch cause of the new schema.

yes but the plugin does this for you, at no point did i mention deleting your db file manually.

30 minutes ago, dual-o said:

backup tsv from Monday. How can I restore it?

yes use your backup from monday to restore.

Link to comment
Share on other sites

seanbuff
31 minutes ago, dual-o said:

How can I restore it?

Within the plugin, 'Settings' tab > 'Backup' > 'Load Backup Data'

Link to comment
Share on other sites

Clangrijan

I just wanted to write to say thank you and congratulations on this amazing plugin. I encourage you to keep maintaining it, as you are doing us all a favor. Thank you very much.

  • Like 1
Link to comment
Share on other sites

dual-o
On 4/27/2023 at 9:16 AM, seanbuff said:

Within the plugin, 'Settings' tab > 'Backup' > 'Load Backup Data'

It works, but it takes a long time in the background. Thanks for your quick reply.

P.S. it would be helpful to have a visual restore progress :)

Link to comment
Share on other sites

  • 4 weeks later...
horstepipe
On 12/15/2022 at 1:53 PM, horstepipe said:

a little request @TeamB

Would you mind adding a sorting option (by Devices, Clients, Users etc.) at the Active Clients screen?

Did you oversee that one or is that no option?

Best regards

Link to comment
Share on other sites

TeamB
3 hours ago, horstepipe said:

Did you oversee that one or is that no option?

Best regards

i forgot ;-/ i will have a look at this

  • Thanks 1
Link to comment
Share on other sites

  • 1 month later...
rbjtech
23 minutes ago, MangoMC said:

Is there a query to see all never watched movies and / or TV Shows? 

I don't believe this is possible from the PlaybackActivity database - as it will only record details for 'played' items.

To query what has never been watched, then you'll need to run the query on the main Emby database for each user, or query via the API.

Link to comment
Share on other sites

  • 2 weeks later...
Schleudertrauma

Hey there,

is it possible to clear the database and start from scratch? I had to set up the server new due to a change of the OS. I implemented a backup but now several users have the same colour and i don't know how to fix that.

I have i.e. 2 users and in the playback chart both users are shown in pink and when i set the colour to blue in the settings tab then the colour changes for both users.

Screenshot 2023-07-28 022137.png

Link to comment
Share on other sites

TeamB

you have a few options to reset the usage data.

1. Set the retention to say 1 day and then run the DB clean task in the scheudled tasks area,  remember to set it back after

2. Run "delete from playback_reporting" in the query tab

3. Shut down emby server and delete the playback_reporting.db file in the data directory, restart emby

Link to comment
Share on other sites

vaise

I want to produce a list of the biggest watchers in a time period.

I pul back data for a year, the data shows 'weeks, days, hours, minutes' i.e 5w 5d 7h 32m.

This is impossible to sort on in excel.

Can you tell me how hours are calculated here ?  is is 24 hours in a day, 168 in a week ?

So I can work it the correct conversion formular in excel to change to hours.

 

Link to comment
Share on other sites

TeamB
1 hour ago, vaise said:

I want to produce a list of the biggest watchers in a time period.

I pul back data for a year, the data shows 'weeks, days, hours, minutes' i.e 5w 5d 7h 32m.

This is impossible to sort on in excel.

Can you tell me how hours are calculated here ?  is is 24 hours in a day, 168 in a week ?

So I can work it the correct conversion formular in excel to change to hours.

 

how and where are you pulling this data from?

try the query tab to write a query to give you the data you need.

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