ginjaninja 533 Posted May 20, 2020 Share Posted May 20, 2020 (edited) Goal Automatically manage a 'curated' recently watched episode playlist, which works on Roku, in a similar vein to Plex's recently watched ribbon. Last time i tested smart playlist and playback reporting plugins, their recently watched playlist's content was not visible on my Roku. Changes v0.0.0.3 - compatibility fix for 4.6.0.X, playlists now seem to need userid not just an apikey to enumerate, userid retrieved from the log. v0.0.0.2beta - not compatable with old csvs and a new config option is required. New - New config option DateTimeFormat - match your Datetime format in (new) log to this option. New - Process.ps1 is now launched automatically by the logger on the onplaybackstopped event, so no need to schedule process.ps1. Ensures the playlist is only a few seconds behind real life. Playlist v0.0.0.3.zip Playlist v0.0.0.2beta.zip Playlist v0.0.0.1.zipCaveats might need latest Powershell and a relaxed Powershell execution policy. tested on Windows but should be agnostic. a bit alpha - learning classes, methods, constructors, functions. issues/suggestions welcome. Edited January 3, 2021 by ginjaninja v0.0.0.3 compatibility fix 3 Link to comment Share on other sites More sharing options...
mastrmind11 717 Posted May 20, 2020 Share Posted May 20, 2020 you guys and your Powershell.... nicely done, dude! Link to comment Share on other sites More sharing options...
Spaceboy 2493 Posted May 21, 2020 Share Posted May 21, 2020 Nice, I’ll give this a go Link to comment Share on other sites More sharing options...
Anthony Musgrove 195 Posted May 23, 2020 Share Posted May 23, 2020 I'm absolutely loving these scripts you're putting together mate. I am so so glad that this is all coming together Link to comment Share on other sites More sharing options...
Spaceboy 2493 Posted May 23, 2020 Share Posted May 23, 2020 well i'm set up. I'll check back in tomorrow after i've watched some stuff tonight and the process script runs overnight Link to comment Share on other sites More sharing options...
ginjaninja 533 Posted May 23, 2020 Author Share Posted May 23, 2020 (edited) well i'm set up. I'll check back in tomorrow after i've watched some stuff tonight and the process script runs overnight interested to see how you get on If you run into problems i would try watching some old stuff manually to create a log "Queue,csv", and run the process script manually from pwsh, so you can see the output. in order for process.ps1 to register a 'watch', the id needs to have a start event on an unplayed item and a stop event with a played item in the log. so a bit of tweaking required if testing on previously "played=true" content. Added to playlist... "onPlaybackStart","False" "onPlaybackStopped","True" Not added to playlist... "onPlaybackStart","True" "onPlaybackStopped","True" "DateTime","Type","ID","Name","Username","Userid","Device","EventType","Played","Processed","Valid","Matched" "23 May 2020 15:59:21","Episode","321997","The Return","User1","6cc6d0fa039849af8147592f5da46188","Chrome","onPlaybackStart","False","No","","" "23 May 2020 15:59:22","Episode","321997","The Return","User1","6cc6d0fa039849af8147592f5da46188","Chrome","onPlaybackStopped","True","No","","" Edited May 23, 2020 by ginjaninja Link to comment Share on other sites More sharing options...
ginjaninja 533 Posted May 23, 2020 Author Share Posted May 23, 2020 (edited) have notice a bug, if unprocessed rows remain in queue.csv when it is processed, the date format is changed and the script failss on subsequent runs...will need to fix that, although if running in middle of night you probably wont see this issue. need to find a way to force a date format on powershells export-csv...ie keep it the same edit have not been able to find a way to control the datetime format internally in memory or on export or really understand how this works across regional cultures and i suspect the script may fail in other cultures.... so for now have added a datetimeformat config option, so user can match the format in their logs in their local region (logging uses the default format).. e.g my logging/default datetime format is "24/05/2020 11:29:33","Episode","322312","What's the Matter with Tony Slattery?","user1","6cc6d0fa039849af8147592f5da46188","Chrome","onPlaybackStart","False","No","","" so i have set my datetimeformat option in config to match (case and separators matter) DateTimeFormat="dd/MM/yyyy HH:mm:ss" hopefully this will make it reliable. updated to v0.0.0.2 Edited May 24, 2020 by ginjaninja Link to comment Share on other sites More sharing options...
ginjaninja 533 Posted November 10, 2020 Author Share Posted November 10, 2020 (edited) updated to 0.0.0.3 compatibility fix, 4.6.0.X needs userid not just api key to enumerate playlists it seems. v0.0.0.2 was creating multiple new playlists rather than updating an existing playlist Edited November 10, 2020 by ginjaninja Link to comment Share on other sites More sharing options...
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