CharlieB 1 Posted December 16, 2024 Posted December 16, 2024 Hi I have a music track as a full filepath wrapped in JSON, that I want to add to the current playing music queue, to the end of the playlist. Can I just deserialise and gift the filepath to Emby and it add it, or do I need to do some kind of search to find an item id first based off the filepath? ChatGPT suggested to use QueueTrackAsync but I don't see any reference to that anywhere! Is there any c# sample code how to add a track? Thanks in advance
CharlieB 1 Posted December 18, 2024 Author Posted December 18, 2024 Any ideas? I thought it would be an easy answer but nobody know??
Luke 42077 Posted January 2, 2025 Posted January 2, 2025 Hi @CharlieBsee ISessionManager.SendPlayCommand Please note, you can only send tracks that are already in the server database. You can't just send any arbitrary file path.
Solution CharlieB 1 Posted January 4, 2025 Author Solution Posted January 4, 2025 Awesome thank you. I figured it out after a lot of head scratching! I've loaded my source code as a proof of concept on github on the link below; https://gist.github.com/CaptainKarma/4e02b1a9965637f6fb7bc855c3a64d58 The example code covers the following workflows which maybe helpful for future developers based off the EmbySimplePlugin/Plugin.cs code stub // Emby C# Code Example // Get the current playing audio item from Emby as a filepath e.g. D:\Music\Artist\Blah.mp3 // Wrapping into a JSON payload and sending externally // Receive a response and pull filepath // Pass the filepath that we want to play and grab the Emby internal media ID (before it can be queued) // Obtaining Emby Session ID to target the correct device // Send a play request to Emby, passing the mediaID and which device should play it 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