muzicman0 59 Posted April 26, 2020 Share Posted April 26, 2020 Is it possible to mark something as watched from the API? I record a show called Heartland for my wife, but I want to mark it as watched as soon as it is done recording. I could use a full on script if I had to, but if I could use the post processing that would be even better (or a combination??). I know enough scripting to be dangerous, but I'm not great. I tried looking through the WIKI, but couldn't find what I was looking for. Thanks for any help! @@chef Link to comment Share on other sites More sharing options...
chef 3745 Posted April 28, 2020 Share Posted April 28, 2020 Yes, I believe you set the baseItem watched ticks to the full runtime ticks. This is a per user method, found when requesting baseItems in the API with a user object attached. Please let me know if you would like code samples. (Hopefully in C#) Link to comment Share on other sites More sharing options...
muzicman0 59 Posted April 28, 2020 Author Share Posted April 28, 2020 code samples would be great. I already have code to authenticate (that I use in another script), but I am not sure where to go from there. Thanks! 1 Link to comment Share on other sites More sharing options...
muzicman0 59 Posted May 5, 2020 Author Share Posted May 5, 2020 Any chance of getting code snippets? I really just need the format of the command, for instance, I have this one: $MediaUrl = $embyServerUrl + "/emby/users/" + $User.User.Id + "/items?Fields=width,height,Path&Recursive=true&IncludeItemTypes=Episode&IsPlayed=True&IsMissing=False&ParentId=6f25559632c2aca7578b4fdc30acb587&SortBy=IndexNumber&SortOrder=Descending" + "&api_key=" + $User.AccessToken That grabs episodes from a specific library that have been watched. I am hoping I can just modify my existing script to send the command to mark it as watched. Link to comment Share on other sites More sharing options...
PenkethBoy 2063 Posted May 5, 2020 Share Posted May 5, 2020 you will need the item ID of each episode and user ID Link to comment Share on other sites More sharing options...
muzicman0 59 Posted May 5, 2020 Author Share Posted May 5, 2020 I tried that, but it didn't seem to work, but then I wasn't 100% sure that I had the right ID. where do I get the ID from? Oh, and THANKS! Link to comment Share on other sites More sharing options...
muzicman0 59 Posted May 5, 2020 Author Share Posted May 5, 2020 would it be 1366453 in the following URL? /web/index.html#!/item?id=1366453&serverId=340d6xxxxxxxxxxx6 Link to comment Share on other sites More sharing options...
PenkethBoy 2063 Posted May 5, 2020 Share Posted May 5, 2020 the id will show in the web browser url for an item should work on a season or series as well - which i assume without testing would then mark all the childitems played Link to comment Share on other sites More sharing options...
PenkethBoy 2063 Posted May 5, 2020 Share Posted May 5, 2020 (edited) Any chance of getting code snippets? I really just need the format of the command, for instance, I have this one: $MediaUrl = $embyServerUrl + "/emby/users/" + $User.User.Id + "/items?Fields=width,height,Path&Recursive=true&IncludeItemTypes=Episode&IsPlayed=True&IsMissing=False&ParentId=6f25559632c2aca7578b4fdc30acb587&SortBy=IndexNumber&SortOrder=Descending" + "&api_key=" + $User.AccessToken That grabs episodes from a specific library that have been watched. I am hoping I can just modify my existing script to send the command to mark it as watched. you already have in the returned json all the id's for individual items - just need to move through the list to find them or if its only one series try what i suggested above Edited May 5, 2020 by PenkethBoy Link to comment Share on other sites More sharing options...
muzicman0 59 Posted May 5, 2020 Author Share Posted May 5, 2020 (edited) Yeah, it's just one series (right now). It would be easier to do the series, as I assume the ID wouldn't change, but it doesn't seem to put the ID in the URL when I am in the series view. EDIT: Ignore the above...it is now showing the series ID. I just uninstalled a plugin and restarted the server, maybe that changed something...either way, I will give this a shot. Edited May 5, 2020 by muzicman0 Link to comment Share on other sites More sharing options...
muzicman0 59 Posted May 5, 2020 Author Share Posted May 5, 2020 Hmm...no matter how I try to format it, all I get is 'unable to find the specified file'. I'm sure I just have the URL wrong. I appreciate the help, I will figure it out. Link to comment Share on other sites More sharing options...
PenkethBoy 2063 Posted May 5, 2020 Share Posted May 5, 2020 ../emby/Users/<userid>/PlayedItems/1772?api_key=<api_key> 1772 is the id of a series just tested and set all episodes to played (watched) you can test in swagger 1 Link to comment Share on other sites More sharing options...
muzicman0 59 Posted May 5, 2020 Author Share Posted May 5, 2020 I know I get my user id from /Users/Public, but I am not sure what it is. I assumed it would be the "Id", but that didn't seem to work. Link to comment Share on other sites More sharing options...
PenkethBoy 2063 Posted May 5, 2020 Share Posted May 5, 2020 go to the users page from the dashboard - click on the user you want to use aand look at the browser url usedid=xxxx.......xxxxx Link to comment Share on other sites More sharing options...
PenkethBoy 2063 Posted May 5, 2020 Share Posted May 5, 2020 or use $User.User.Id from your example above Link to comment Share on other sites More sharing options...
muzicman0 59 Posted May 5, 2020 Author Share Posted May 5, 2020 (edited) so weird. That is what I was using. My entire line (with some thing's x'd out) is: http://10.1.0.122:8096/emby/Users/xxxxxxxxxxxxxxxxxxxxxxx/PlayedItems/1271075?api_key=xxxxxxxxxxxxxxxxxxxxxxxxxxxx I got the API key from the dashboard under API. But it still doesn't work. Same error. Edited May 5, 2020 by muzicman0 Link to comment Share on other sites More sharing options...
muzicman0 59 Posted May 6, 2020 Author Share Posted May 6, 2020 Got it working. Doesn't seem to work if you do it from a browser, but works from the PowerShell script you helped me with for my other project. Thanks again! 1 Link to comment Share on other sites More sharing options...
muzicman0 59 Posted June 24, 2020 Author Share Posted June 24, 2020 So the problem I am having with this right now is that the ID of the series keeps changing for some reason. Does the ID get 're-created' if all episodes are deleted? The series.nfo is staying, but it doesn't seem to matter, the series ID keeps changing anyway. Link to comment Share on other sites More sharing options...
Luke 37049 Posted June 24, 2020 Share Posted June 24, 2020 That could happen, yes. Link to comment Share on other sites More sharing options...
muzicman0 59 Posted June 24, 2020 Author Share Posted June 24, 2020 Hmmm. OK, I guess I will have to look into a way to find the series ID based on name, or an episode ID based on name. 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