MLMBB 0 Posted October 29, 2024 Posted October 29, 2024 There is no way i can see the data before the install?
MLMBB 0 Posted October 29, 2024 Posted October 29, 2024 5 minutes ago, MLMBB said: I Dont have restore data i want to do it with SQL please Teach Me There is no way i can put the old data Before the install?
TeamB 2438 Posted October 29, 2024 Author Posted October 29, 2024 36 minutes ago, MLMBB said: There is no way i can see the data before the install? correct, there is no data before the install 33 minutes ago, MLMBB said: There is no way i can put the old data Before the install? no, if you do not have the data, then you can not load it. RplayBackReporting monitors and logs the data, but it needs to be installed to be that. It will start monitoring when you install it, it does not know anything from before it was installed
EmYaj 25 Posted November 12, 2024 Posted November 12, 2024 On 10/27/2024 at 9:04 AM, Q-Droid said: You can try this: SELECT distinct itemname FROM PlaybackActivity where itemtype = 'Episode' and datecreated >= datetime('now','-6 months') order by 1 Thank you for the reply, this gave me an output of individual episodes, is it possible to do show titles? If not that's ok I can prob put the list in to excel and filter it down that way
Q-Droid 989 Posted November 12, 2024 Posted November 12, 2024 (edited) Show title isn't in the plugin table. You can parse out the title from the episode name but this would be very dependent on consistent naming. The plug-in might be using API calls to get this name, maybe not. To test it you can run this query (I commented out the date test to return everything): SELECT distinct substr(itemname,1,instr(itemname,' - ') -1), itemname FROM PlaybackActivity where itemtype = 'Episode' --and datetime(datecreated) >= datetime('now','-6 months') order by 1,2 And if you get clean and consistent names you can change to this one: SELECT distinct substr(itemname,1,instr(itemname,' - ') -1) show_title FROM PlaybackActivity where itemtype = 'Episode' and datetime(datecreated) >= datetime('now','-6 months') order by 1 Edited November 12, 2024 by Q-Droid syntax 1
Jay1911 7 Posted November 12, 2024 Posted November 12, 2024 9 hours ago, Q-Droid said: Show title isn't in the plugin table. You can parse out the title from the episode name but this would be very dependent on consistent naming. The plug-in might be using API calls to get this name, maybe not. To test it you can run this query (I commented out the date test to return everything): SELECT distinct substr(itemname,1,instr(itemname,' - ') -1), itemname FROM PlaybackActivity where itemtype = 'Episode' --and datetime(datecreated) >= datetime('now','-6 months') order by 1,2 And if you get clean and consistent names you can change to this one: SELECT distinct substr(itemname,1,instr(itemname,' - ') -1) show_title FROM PlaybackActivity where itemtype = 'Episode' and datetime(datecreated) >= datetime('now','-6 months') order by 1 this worked fantastic! Thank you so much for the help 1
Justus 8 Posted December 23, 2024 Posted December 23, 2024 In the Settings tab, you can choose to ignore all playbacks that are less than x seconds. Is it also possible to ignore all TV show playbacks that are longer than 1 hour? I noticed that sometimes, especially with TV apps like Samsung TV, the show is still counted as playing even when the TV is turned off. As a result, episodes can end up being recorded as watched for 28 hours straight, which skews the statistics. I know the entry can be deleted manually, but it would be great to have this happen automatically as well.
EmYaj 25 Posted January 7, 2025 Posted January 7, 2025 (edited) On 10/1/2024 at 4:51 PM, TeamB said: the short answer is unfortunately no, the plugin can not do this. while most of the data you need to calculate this is there in the stored info and you do have access to the data using the query tab to run sql queries against the data you would need extra processing of the data to get what you want. one thing you could experiment with is exporting the data and using something like python to process the data to give you what you want. On a whim I asked Deepseek to write me a query and it does spit out numbers that look like they could be correct but I have no real way of confirming they are 100% correct. Thought I'd post here just in case it is useful to anyone. Disclaimer: I have zero experience with this and nothing below means anything to me. Peak livetv streams broken down by day over the past 1 week: WITH PlaybackSessions AS ( SELECT ROWID AS StreamId, -- Use SQLite's built-in ROWID as the unique identifier DateCreated AS StartTime, DATETIME(DateCreated, '+' || PlayDuration || ' seconds') AS EndTime FROM PlaybackActivity WHERE ItemType LIKE 'TvChannel' AND DateCreated >= DATE('now', '-7 days') ), TimePoints AS ( SELECT StartTime AS TimePoint FROM PlaybackSessions UNION SELECT EndTime FROM PlaybackSessions ), ConcurrentCounts AS ( SELECT t.TimePoint, COUNT(p.StreamId) AS ConcurrentStreams FROM TimePoints t JOIN PlaybackSessions p ON t.TimePoint BETWEEN p.StartTime AND p.EndTime GROUP BY t.TimePoint ) SELECT DATE(t.TimePoint) AS Day, MAX(c.ConcurrentStreams) AS PeakConcurrentStreams FROM TimePoints t JOIN ConcurrentCounts c ON t.TimePoint = c.TimePoint GROUP BY DATE(t.TimePoint) ORDER BY Day DESC; Edited January 7, 2025 by EmYaj
TeamB 2438 Posted January 7, 2025 Author Posted January 7, 2025 4 hours ago, EmYaj said: On a whim I asked Deepseek to write me a query and it does spit out numbers that look like they could be correct but I have no real way of confirming they are 100% correct. Thought I'd post here just in case it is useful to anyone. Disclaimer: I have zero experience with this and nothing below means anything to me. Peak livetv streams broken down by day over the past 1 week: WITH PlaybackSessions AS ( SELECT ROWID AS StreamId, -- Use SQLite's built-in ROWID as the unique identifier DateCreated AS StartTime, DATETIME(DateCreated, '+' || PlayDuration || ' seconds') AS EndTime FROM PlaybackActivity WHERE ItemType LIKE 'TvChannel' AND DateCreated >= DATE('now', '-7 days') ), TimePoints AS ( SELECT StartTime AS TimePoint FROM PlaybackSessions UNION SELECT EndTime FROM PlaybackSessions ), ConcurrentCounts AS ( SELECT t.TimePoint, COUNT(p.StreamId) AS ConcurrentStreams FROM TimePoints t JOIN PlaybackSessions p ON t.TimePoint BETWEEN p.StartTime AND p.EndTime GROUP BY t.TimePoint ) SELECT DATE(t.TimePoint) AS Day, MAX(c.ConcurrentStreams) AS PeakConcurrentStreams FROM TimePoints t JOIN ConcurrentCounts c ON t.TimePoint = c.TimePoint GROUP BY DATE(t.TimePoint) ORDER BY Day DESC; interesting approach, perhaps if we can verify the results it might be worth adding as a report type.
darkassassin07 652 Posted February 3, 2025 Posted February 3, 2025 Hey @TeamB When looking at the breakdown page; I often see playback counts quite a bit higher than the number of times an item was actually watched. This can happen for a variety of reasons like forgetting to set the correct audio/video/sub tracks, a group not actually being ready to start yet, or just playback hiccups. An example: I had a user watch The Phantom Of The Opera once this month, but because of whatever she was doing before settling in; it's the top watched movie by count at 8 'seprate' playbacks.... Everything under a minute of playtime I wouldn't consider 'a playback', I'd call this whole list one. Could we look at adding a setting for minimum playback time, or better yet percentage before that playback counter is incremented? Or perhaps make those counts dependant on total playtime divided by runtime rounded to the nearest int? I think it would make all the item count stats in breakdown a little more useful. Did I actually serve 122 items to xbox clients this mo, or was it just 50 that we had to try 3 times to play?
TeamB 2438 Posted February 3, 2025 Author Posted February 3, 2025 2 hours ago, darkassassin07 said: Could we look at adding a setting for minimum playback time, or better yet percentage before that playback counter is incremented? i think it might be there already, i can not check atm, have a look in settings.
darkassassin07 652 Posted February 3, 2025 Posted February 3, 2025 Yeah, I'm just blind apparently. I did check before posting, but managed to gloss over that one line Thanks!
ItayT 5 Posted March 11, 2025 Posted March 11, 2025 (edited) Hi, is that plugin no longer supported? I can't find it in the plugins catalogue EDIT: Nevermind, found it! It's not in the mobile app's catalogue but it appears in the web browser's catalogue Edited March 11, 2025 by ItayT
gihayes 47 Posted March 13, 2025 Posted March 13, 2025 Great Plugin. It really gives me insight into my server's use. Many thanks. Using the Playback Report Settings tab, I created two playlist that show the most watched Movies and Episodes for the past seven days. Unfortunately, there is only the option to create playlists for Movies and Episodes, not for Audio. Is this planed for a future update for the plugin? If not, is there a way to accomplish this via a query?
rbjtech 5284 Posted March 14, 2025 Posted March 14, 2025 (edited) The Plugin is open source - so if you have Visual Studio then you can probably add the value in the playback_report_settings.html file <select id="activity_playlist_type" title="Playlist item type"> <option value="Movie" selected>Movies</option> <option value="Episode">Episodes</option> *** add here *** <option value="Audio">Audio</option> If you don't, then maybe @TeamBcan add as assuming the associated js file works with Audio, then it may be an easy thing to add... From a SQL perspective, just specify the ItemType = 'Audio' .. SELECT date(DateCreated) AS Date, SUM(PlayDuration) AS PlayTime FROM PlaybackActivity WHERE ItemType = 'Audio' GROUP BY date(DateCreated) ORDER BY date(DateCreated) ASC Edited March 14, 2025 by rbjtech 1
soundiiz 1 Posted March 16, 2025 Posted March 16, 2025 Thanks for the reply. I've only gone through a few VS tutorials a while back (Over 10 years ago, lol) but I will attempt it. I just downloaded playback_reporting_develop.zip from Github and will download VS and install next. Wish me luck. Lol.
soundiiz 1 Posted March 16, 2025 Posted March 16, 2025 After installing VS, I edited playback_report_settings.html and added the additional audio line of code. I did a build and got no errors. I shut down Emby and replaced the playback_reporting.dll in the plugins directory with the new one. I then restarted Emby. I went to the plugin settings, but noticed no change. It still only had the Episode and Movie options. Emby was also telling me that the plugin had been updated and I had to restart Emby so I did. After restarting, the plugin still only had the 2 options. So I shut down Emby, replaced the dll, and rebooted the computer. When it came back up, the Audio option was there but Emby was telling me that the Playback Reporting plugin had been updated and I needed to restart. So before I restarted, I created an Audio Activity playlist of the last 7 days and ran the Scheduled task for it. The task reported an error but the playlist was created. I then restarted Emby. When I went to Playback Reporting settings the Audio option was gone but the definition for the playlist was still there. I played some songs and audiobook chapters then ran the scheduled task for the plugin. The task reported no errors, but the list was empty. Also, the Audio playlist Definition could not be edited and saved because the dropdown no longer had an Audio option and could only be filled in with Movies or Episodes. If you attempt to edit it the Definition for the Audio plalist even if you don't save it, it will break it and it will then become a movie playlist. Which is what happened to me. So, I tried replacing the Dlll while Emby was still running then rebooted. When it came back up, the audio option was present and Emby wanted me to restart because it said the plugin had been updated. I edited the Audio playlist using audio from the drop-down and saved it. I then ran the scheduled task. I got an error and an empty playlist. I restarted Emby, then reran the task, I got no error, and now the playlist works. The option to make more Audio Activity playlists is gone, but the one I made is working. Thanks! 1
darkassassin07 652 Posted March 16, 2025 Posted March 16, 2025 3 hours ago, soundiiz said: Emby was also telling me that the plugin had been updated and I had to restart Emby so I did. Uninstall the version from the plugin catalog; then place your new dll in the plugins folder. Emby is re-installing the catalog version as it doesn't match what's in the folder. 1
rbjtech 5284 Posted March 16, 2025 Posted March 16, 2025 7 hours ago, soundiiz said: After installing VS, I edited playback_report_settings.html and added the additional audio line of code. I did a build and got no errors. I shut down Emby and replaced the playback_reporting.dll in the plugins directory with the new one. I then restarted Emby. I went to the plugin settings, but noticed no change. It still only had the Episode and Movie options. Emby was also telling me that the plugin had been updated and I had to restart Emby so I did. After restarting, the plugin still only had the 2 options. So I shut down Emby, replaced the dll, and rebooted the computer. When it came back up, the Audio option was there but Emby was telling me that the Playback Reporting plugin had been updated and I needed to restart. So before I restarted, I created an Audio Activity playlist of the last 7 days and ran the Scheduled task for it. The task reported an error but the playlist was created. I then restarted Emby. When I went to Playback Reporting settings the Audio option was gone but the definition for the playlist was still there. I played some songs and audiobook chapters then ran the scheduled task for the plugin. The task reported no errors, but the list was empty. Also, the Audio playlist Definition could not be edited and saved because the dropdown no longer had an Audio option and could only be filled in with Movies or Episodes. If you attempt to edit it the Definition for the Audio plalist even if you don't save it, it will break it and it will then become a movie playlist. Which is what happened to me. So, I tried replacing the Dlll while Emby was still running then rebooted. When it came back up, the audio option was present and Emby wanted me to restart because it said the plugin had been updated. I edited the Audio playlist using audio from the drop-down and saved it. I then ran the scheduled task. I got an error and an empty playlist. I restarted Emby, then reran the task, I got no error, and now the playlist works. The option to make more Audio Activity playlists is gone, but the one I made is working. Thanks! Good job ! As @darkassassin07has advised - as you have modified the code using (I assume) the same GUID (Plugin.cs) and/or version number (.csproj file) the Catalogue is trying to overwrite it - so either remove the Cat version, or if you want to keep it your version, then I'd suggest changign the GUID (VS has a GUID creator you can use). As you say it is working (and as I thought, it just didn't list the option in the html) then hopefully @TeamB can add for other users.
TeamB 2438 Posted March 16, 2025 Author Posted March 16, 2025 submit a pull request and i will release a new version
gihayes 47 Posted March 17, 2025 Posted March 17, 2025 (edited) Thanks @rbjtechand @TeamB. I am new to all this lol. I guess by the time I finish, I'll be a VS expert and makin' my own plugins. Lol. I will figure out how to submit a pull request. P.S I was using another ID by mistake initially. @gihayesand @soundiizare both me. Edited March 17, 2025 by gihayes
TeamB 2438 Posted March 17, 2025 Author Posted March 17, 2025 if you dont want to have to create a GitHub pull request (it can be a little overwhelming to new comers) then send me the changes and I can merge them in.
gihayes 47 Posted March 17, 2025 Posted March 17, 2025 Thanks @TeamB, Attached is the only file changed. It was in the the Pages directory. The only change to the file was: select id="activity_playlist_type" title="Playlist item type"> <option value="Movie" selected>Movies</option> <option value="Episode">Episodes</option> *** New line added here *** <option value="Audio">Audio</option> playback_report_settings.html 2
gihayes 47 Posted March 17, 2025 Posted March 17, 2025 Ok. I've tried my hand at doin' the Pull Request. I hope it was correct. 1
TeamB 2438 Posted March 18, 2025 Author Posted March 18, 2025 Thanks, good work, merged, it will be in the next release in a few days. 1 1
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now