I've been reading Jellyfin API documentation instead of studying, and I wanted to make something, so all the knowledge doesn't just disappear.
This combines a bunch of things I'm not very familiar with, so it might be bad. I know there's quite a few error checks I haven't done.
Drop the plugin DLL in <VNyanDir>/Items/Assemblies.
After it's been run once, the plugin makes a file called md_JF in your VNyan profile folder. There, you can configure the plugin.
"Host"is the address of your Jellyfin server. That would be something like"https://jf.srv.milkydelta.moe"."ApiKey"is your api key. Those are obtained from the admin dashboard."DeviceName"is the name of the device you want to track. That's the text in the Device column of the Devices tab of the admin dashboard. If you're using the web client, you should probably edit the name to be more unique.
The plugin button reloads that file and re-does some initialisation, so you can edit the config without restarting VNyan.
The plugin has a background thread. Twice every second, that thread requests information about the named device's session. Based on the information returned, some parameters will be set, and some triggers will be called, so you can take action in the node graph.
I've tested with Shows, Albums, and Movies. My media collection has no e-books or audiobooks, so I haven't tested those.
_md_jf_pos- Current playhead position, in seconds._md_jf_run- Length of currently playing item, in seconds._md_jf_pos_s- Current playhead position, as H:MM:SS string._md_jf_run_s- Length of currently playing item, as H:MM:SS string.
If nothing is playing, the numeric parameters will be set to 0, and the string parameters will be set to 0:00:00
_md_jf_startmedia- Sent when the NowPlayingItem turns from nothing to something.- value1 - IndexNumber (Episode number for shows, track number for music, 0 for other things)
- value2 - ParentIndexNumber (Season number for shows, disc number for music, 0 for other things)
- text1 - Name of the item
- text2 - SeriesName or Album
- text3 - Type of item.
- This is taken from
BaseItemDto's Type field, which is a very big enum for all the things an item can be. The ones you're likely to see areEpisode,Audio(for music),Movie,Video(for extras),Book, andAudioBook.
- This is taken from
_md_jf_stopmedia- Sent if playback stops, or if your Jellyfin session closes- Can also be sent when advancing to the next item in a playlist.
_md_jf_onpause- Sent if the currently playing item previously was not paused, and now is._md_jf_onunpause- Sent if the currently playing item previously was paused, and now is not.
_md_jf_<Command>- Change the play state of the current session<Command>can be any one ofStop,Pause,Unpause,NextTrack,PreviousTrack,Seek, orPlayPause.FastForwardandRewindare also supported, but they don't seem to do anything.- For
Seek, you can pass the seek location into value1, as an integer amount of seconds.
For the assembly references to resolve, you will need to provide the location of your VNyan install. I do that with a short file that looks like this.
VNJF.csproj.user
<Project>
<PropertyGroup>
<VNyanDir>/blah/blah/VNyan</VNyanDir>
</PropertyGroup>
</Project>Once you've done that, it's just a regular dotnet build