bwarthen 13 Posted May 26, 2024 Posted May 26, 2024 (edited) I'm working on my first plugin for Emby. I'm working on a multiple channel plugin that will pull in the similar items to the last 3 things you watched. On initial load everything is working as expected but after I rerun the "Refresh Internet Channels" Job all the libraries contain the same thing. How can I fix this? Edited May 26, 2024 by bwarthen
bwarthen 13 Posted May 26, 2024 Author Posted May 26, 2024 Here is the initial load and the logs after the second refresh. embyserver.txt
Luke 42077 Posted May 26, 2024 Posted May 26, 2024 HI, yes that is odd. Do all of those entries have accurate data for things like genres, cast members, studios, external ids, etc?
bwarthen 13 Posted May 27, 2024 Author Posted May 27, 2024 Yes the data is there and accurate. When I try to go into a library though it never loads.
bwarthen 13 Posted May 27, 2024 Author Posted May 27, 2024 When you click to go into the library to view everything inside. Nothing ever loads.
bwarthen 13 Posted May 28, 2024 Author Posted May 28, 2024 Ok I've figured something out. I has to do with the dynamic channel name "Because you watched Movie x". I have narrowed it to just 2 channels 1 for movies and 1 for Series. With a static name the content comes in fine after multiple refreshes. My next question would be for Series. Is there a way to pull the Series folder and the episodes under it?
Luke 42077 Posted June 1, 2024 Posted June 1, 2024 Quote I has to do with the dynamic channel name Hi, what do you mean? What exactly is dynamic?
bwarthen 13 Posted June 1, 2024 Author Posted June 1, 2024 I mean that I'm making the names based off of which movies or shows have been watched the last 3 of each to be precise and when I set the name the way I was the result was a mixture of shows and movies as seen in my screenshot. I've figured that part out I believe but I need to figure out how to display tv series with the episodes that belong to that series.
Luke 42077 Posted June 1, 2024 Posted June 1, 2024 You mean the name of the entire channel? If so, that's never been done before so I'm not sure if that will be a problem or not. But you can do that for content underneath the channel.
bwarthen 13 Posted June 6, 2024 Author Posted June 6, 2024 Can someone supply some sample code on how I would get the series/seasons to display like show and a number for unwatched episodes like a tv show library? I know it has something to do with using folder at the series level then same for season level and finally listing out the episodes. Any time I'm using folder though it just never finished the internet channel refresh. Any help on this would be greatly appreciated. The alternative would be to copy and create a new library then delete that library when I refresh the channels. I definitely don't want to do that workaround.
bakes82 167 Posted June 11, 2024 Posted June 11, 2024 Are you using your media as the source. If so you will have duplicate database entries to worry about. If I recall the “names” are also only set on server load, but it’s been a few since I worked with channels because of the db duplication. In order to show series -> seasons -> episodes you need to handle it in the getchannelitems. The method gets called for each level so you need to handle the logic for series, then it called the method again when you click the series so you need to show all the seasons, when you click a season you then need to return all the episodes. when using the items on your server as the source you need to also get the currents in the channel so you don’t readd the same items becuse channel items will be returned back as part of the dataset. You should also cache the return items per level so you’re not querying the db constantly. you’re better off just putting the items in a collection and hoping they allow pinning them to the Home Screen. They said it was “coming” but that’s been a year or so now so you know how that goes.
bwarthen 13 Posted June 11, 2024 Author Posted June 11, 2024 I've decide to just create new libraries with steam files. Just have to go through and figure out how to create the libraries through code. Just haven't had a lot of time lately. 1
bwarthen 13 Posted June 17, 2024 Author Posted June 17, 2024 Would it be possible to trigger a scheduled task on items being marked as played?
Luke 42077 Posted June 17, 2024 Posted June 17, 2024 There is no task trigger for that but you could listen for events and then do your own operations.
bwarthen 13 Posted June 17, 2024 Author Posted June 17, 2024 Thanks for the reply. That is what I will do then. 1
bwarthen 13 Posted July 4, 2024 Author Posted July 4, 2024 Finally got the chance to work on this again and I have one thing left to get ironed out I believe. I have a code snippet that I believe should be granting access to the newly created libraries. However that doesn't seem to be happening. public void grantUserAccess(User user) { user.Policy.EnableAllFolders = false; var enabledFolders = user.Policy.EnabledFolders != null ? user.Policy.EnabledFolders.ToList() : new List<string>(); var libraries = LibraryManager.GetItemList(new InternalItemsQuery { NameStartsWith = "Because You Watched", }); foreach(var library in libraries) { enabledFolders.Add(library.Id.ToString().Replace("-",string.Empty)); } user.Policy.EnabledFolders = enabledFolders.ToArray(); UserManager.UpdateUser(user); } I've stepped through the code and the folder guid is being added to the list but still not granting access to the user. I also looked at the logs and there is nothing there that I can see but I've attached them just in case. I'm probably missing something simple here. Please point me in the right direction. embyserver (1).txt
Luke 42077 Posted July 5, 2024 Posted July 5, 2024 Hi, try using UpdateUserPolicy instead of UpdateUser.
bwarthen 13 Posted July 30, 2024 Author Posted July 30, 2024 I am very close to having this plugin ready for prime time. I've been testing for some time locally and working out any bugs that come up. I see that I need some credentials to include the plugin in the catalogue. Would I do that here or some other location?
ebr 16169 Posted July 30, 2024 Posted July 30, 2024 1 hour ago, bwarthen said: I am very close to having this plugin ready for prime time. I've been testing for some time locally and working out any bugs that come up. I see that I need some credentials to include the plugin in the catalogue. Would I do that here or some other location? Hi. Before making a plug-in available in the catalog, we like to have you publish it in the forum to garner interest from users and do some initial testing. You can create a thread in the Plugins forum to do this. Thanks.
bwarthen 13 Posted July 30, 2024 Author Posted July 30, 2024 Great that sounds good when I have it ready for prime time I will do that. 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