chef 3746 Posted May 28, 2019 Share Posted May 28, 2019 (edited) Could someone please tell me what in the world I'm missing for this IService Endpoint Class. It is unaccessible in my plugin and I honestly can't figure out why: using MediaBrowser.Controller.Devices; using MediaBrowser.Model.Devices; using MediaBrowser.Model.Serialization; using MediaBrowser.Model.Services; using System.Collections.Generic; namespace VeraHomeAutomation { //To many repetitive devices in a normal List<DeviceInfo> so weed out the duplicates //CHROME YOU ARE TO BLAME! quit changing the last four characters in your ID's!!!! [Route("Vera/SortedDevices", "GET", Summary = "Sorted Device List End Point")] public class SortedDeviceService : IService { public IDeviceManager DeviceManager { get; set; } public IJsonSerializer JsonSerializer { get; set; } public EmbyDeviceService(IDeviceManager dM, IJsonSerializer jS) { DeviceManager = dM; JsonSerializer = jS; } public string Get() { var deviceInfo = DeviceManager.GetDevices(new DeviceQuery()); var deviceList = new List<DeviceInfo>(); foreach (var device in deviceInfo.Items) { if (!deviceList.Exists(x => x.Name.ToLower() == device.Name.ToLower() && x.AppName.ToLower() == device.AppName.ToLower())) { deviceList.Add(device); } } return JsonSerializer.SerializeToString(deviceList); } } } Thank you. Edited May 28, 2019 by chef Link to comment Share on other sites More sharing options...
Luke 37112 Posted May 28, 2019 Share Posted May 28, 2019 Have you compared to existing examples such as Auto Organize? https://github.com/MediaBrowser/Emby.AutoOrganize/tree/master/Emby.AutoOrganize/Api 1 Link to comment Share on other sites More sharing options...
chef 3746 Posted May 28, 2019 Author Share Posted May 28, 2019 (edited) Thank you, Yes the I understand now about the routing class, and also also a note that the route must start with a "/". It now works. Edited May 28, 2019 by chef 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