jesseward / jellyfin-plugin-lastfm

LastFM plugin for the Jellyfin media system. Fork of the Emby Last.FM plug-in
178 stars 11 forks source link

Fix Jellyfin crashing when Item.Artists in PlaybackStart/PlaybackStopped is empty #36

Closed uwx closed 2 years ago

uwx commented 2 years ago

Fixes #35. This crash is caused by a song's Artists field being empty when Jellyfin is missing metadata for it. The call to First() throws an exception when the list is empty, instead of simply defaulting to null. With this fix, it will simply log a message like:

[21:04:28] [INF] [32] Jellyfin.Plugin.Lastfm.ServerEntryPoint: track D:\Music\PAYDAY 2 - Soundtrack\payday_2_soundtrack_remix_material\fuse_box_132_bpm\fuse_box_synth_4.wav is missing artist (null) or track name (fuse_box_synth_4) metadata. Not submitting
jesseward commented 2 years ago

Thanks for submitting.