{"record":{"id":"0168f30224c84f01","repo":"rocksdanister/lively","slug":"wallpaper-player-not-found","errorCode":null,"errorMessage":"Wallpaper player not found.","messagePattern":"Wallpaper player not found\\.","errorType":"exception","errorClass":"PluginNotFoundException","httpStatus":null,"severity":"error","filePath":"src/Lively/Lively/Factories/WallpaperPluginFactory.cs","lineNumber":206,"sourceCode":"                                                        display,\n                                                        lpFactory.CreateLivelyPropertyFolder(model, display, arrangement, userSettings),\n                                                        userSettings.Settings.WebDebugPort,\n                                                        userSettings.Settings.CefDiskCache,\n                                                        userSettings.Settings.ApplicationTheme,\n                                                        userSettings.Settings.AudioVolumeGlobal),\n                            _ => new WebWebView2(model.FilePath,\n                                                    model,\n                                                    display,\n                                                    userSettings.Settings.WebDebugPort,\n                                                    lpFactory.CreateLivelyPropertyFolder(model, display, arrangement, userSettings),\n                                                    GetWebView2UserDataDir(arrangement, display, isWindowed),\n                                                    userSettings.Settings.ApplicationTheme,\n                                                    userSettings.Settings.AudioVolumeGlobal,\n                                                    GetWebView2Scale(display, isWindowed)),\n                        };\n                    }\n            }\n            throw new PluginNotFoundException(\"Wallpaper player not found.\");\n        }\n\n        private string GetWebView2UserDataDir(WallpaperArrangement arrangement, DisplayMonitor display, bool isWindowed)\n        {\n            return userSettings.Settings.CefDiskCache && !isWindowed ? \n                webView2UserDataFactory.GetUserDataFolder(arrangement, display) : webView2UserDataFactory.GetTempUserDataFolder();\n        }\n\n        private double? GetWebView2Scale(DisplayMonitor display, bool isWindowed)\n        {\n            if (isWindowed || !displayManager.IsMultiScreen())\n                return null;\n\n            // When running as child of WorkerW/Progman, the WebView2 surface does not pick up the correct DPI. \n            return DpiUtil.TryGetDisplayScale(display.HMonitor, out double targetScale) ? targetScale : null;\n        }\n\n        #region exceptions","sourceCodeStart":188,"sourceCodeEnd":224,"githubUrl":"https://github.com/rocksdanister/lively/blob/c1036feb664960722e34bf4309042c247d6a909d/src/Lively/Lively/Factories/WallpaperPluginFactory.cs#L188-L224","documentation":"Terminal throw at the end of CreateWallpaper; reached only when no case produced an IWallpaper. The outer switch has no default and each inner player-enum switch (WebBrowser/VideoPlayer/GifPlayer/PicturePlayer) has no default either, so an unhandled WallpaperType or an unhandled player-enum value falls straight through to this throw. It is effectively an 'incomplete switch' signal, not a normal runtime error.","triggerScenarios":"CreateWallpaper returns from none of its cases: model.LivelyInfo.Type is an enum value with no case, or the inner player switch has no matching case for the configured value (e.g. WebBrowser other than cef/webview2, VideoPlayer with no case, GifPlayer/PicturePlayer with no case).","commonSituations":"A new WallpaperType or player enum value was added but the factory wasn't updated. A build compiled without CEF (so the web switch only has webview2) while config selects cef. A corrupted LivelyInfo.Type that resolves to an undefined enum member.","solutions":["Log model.LivelyInfo.Type and the active player-enum value at the call site before invoking CreateWallpaper to see which dimension was unhandled.","Add a default arm to each inner switch that either picks a known-good backend or throws a precise, type-specific message.","Ensure the shipped build compiles in at least one backend for each wallpaper category the enum advertises."],"exampleFix":"// before\n            }\n            throw new PluginNotFoundException(\"Wallpaper player not found.\");\n        }\n\n// after: diagnose which dimension was unhandled\n            var combo = model.LivelyInfo.Type switch\n            {\n                WallpaperType.web or WallpaperType.webaudio or WallpaperType.url => $\"web:{userSettings.Settings.WebBrowser}\",\n                WallpaperType.video => $\"video:{userSettings.Settings.VideoPlayer}\",\n                WallpaperType.gif   => $\"gif:{userSettings.Settings.GifPlayer}\",\n                WallpaperType.picture => $\"picture:{userSettings.Settings.PicturePlayer}\",\n                _ => $\"{model.LivelyInfo.Type}\"\n            };\n            throw new PluginNotFoundException($\"Wallpaper player not found (type/player={combo}).\");","handlingStrategy":"validation","validationCode":"static bool IsFactoryComboSupported(LibraryModel m, IUserSettingsService s) =>\n    m.LivelyInfo.Type switch\n    {\n        WallpaperType.web or WallpaperType.webaudio or WallpaperType.url =>\n            s.Settings.WebBrowser is LivelyWebBrowser.cef or LivelyWebBrowser.webview2,\n        WallpaperType.video =>\n            s.Settings.VideoPlayer is LivelyMediaPlayer.wmf or LivelyMediaPlayer.libvlcExt\n                or LivelyMediaPlayer.mpv or LivelyMediaPlayer.vlc,\n        WallpaperType.gif =>\n            s.Settings.GifPlayer is LivelyGifPlayer.mpv or LivelyGifPlayer.libvlcExt,\n        WallpaperType.picture =>\n            s.Settings.PicturePlayer is LivelyPicturePlayer.winApi\n                or LivelyPicturePlayer.mpv or LivelyPicturePlayer.wmf,\n        WallpaperType.videostream => true,\n        _ => false\n    };","typeGuard":"static bool IsKnownWallpaperType(LibraryModel m) =>\n    Enum.IsDefined(typeof(WallpaperType), m.LivelyInfo.Type);","tryCatchPattern":"try\n{\n    var wp = factory.CreateWallpaper(model, display, arrangement);\n}\ncatch (WallpaperPluginFactory.PluginNotFoundException ex)\n{\n    Logger.Error(ex, \"No backend for type={Type}\", model.LivelyInfo.Type);\n    // fall back to a guaranteed-present backend, or surface a precise message to the user\n}","preventionTips":["Give every switch in CreateWallpaper a default arm so an unhandled enum fails loudly with context, not at the generic fallback.","Add a unit test that iterates every (WallpaperType, player-enum) pair and asserts at least one returns non-null for the default config.","Treat 'Wallpaper player not found.' in logs as a bug to fix in the factory, not a user error."],"tags":["wallpaper","config","enum","fallback","csharp","diagnostics"],"backgroundTag":null,"analyzedSha":"c1036feb664960722e34bf4309042c247d6a909d","analyzedAt":"2026-08-13T13:03:12.648Z","schemaVersion":2},"datasetVersion":"2026-08-13T14:17:21.547Z"}