{"record":{"id":"268f88c2e2c90585","repo":"rocksdanister/lively","slug":"livelyinfo-json-not-found","errorCode":null,"errorMessage":"LivelyInfo.json not found","messagePattern":"LivelyInfo\\.json not found","errorType":"exception","errorClass":"FileNotFoundException","httpStatus":null,"severity":"error","filePath":"src/Lively/Lively.Common/Factories/WallpaperLibraryFactory.cs","lineNumber":19,"sourceCode":"﻿using Lively.Common.Extensions;\nusing Lively.Common.Helpers.Files;\nusing Lively.Common.Helpers.Shell;\nusing Lively.Common.Helpers.Storage;\nusing Lively.Models;\nusing Lively.Models.Enums;\nusing System;\nusing System.Drawing.Imaging;\nusing System.IO;\nusing System.Threading.Tasks;\n\nnamespace Lively.Common.Factories\n{\n    public class WallpaperLibraryFactory : IWallpaperLibraryFactory\n    {\n        public LivelyInfoModel GetMetadata(string folderPath)\n        {\n            if (!File.Exists(Path.Combine(folderPath, \"LivelyInfo.json\")))\n                throw new FileNotFoundException(\"LivelyInfo.json not found\");\n\n            return JsonStorage<LivelyInfoModel>.LoadData(Path.Combine(folderPath, \"LivelyInfo.json\")) ?? throw new FileNotFoundException(\"Corrupted wallpaper metadata\");\n        }\n\n        public LibraryModel CreateFromDirectory(string folderPath)\n        {\n            var metadata = GetMetadata(folderPath);\n            var result = new LibraryModel\n            {\n                LivelyInfo = metadata,\n                LivelyInfoFolderPath = folderPath,\n                LivelyInfoLocalizationPath = Path.Combine(folderPath, \"LivelyInfo.loc.json\"),\n                LivelyPropertyLocalizationPath = Path.Combine(folderPath, \"LivelyProperties.loc.json\"),\n                IsSubscribed = !string.IsNullOrEmpty(metadata.Id),\n                Title = metadata.Title,\n                Desc = metadata.Desc,\n                Author = metadata.Author\n            };","sourceCodeStart":1,"sourceCodeEnd":37,"githubUrl":"https://github.com/rocksdanister/lively/blob/c1036feb664960722e34bf4309042c247d6a909d/src/Lively/Lively.Common/Factories/WallpaperLibraryFactory.cs#L1-L37","documentation":"Thrown by WallpaperLibraryFactory.GetMetadata when no LivelyInfo.json exists in the supplied folderPath. LivelyInfo.json is the manifest every lively wallpaper directory/zip must ship; without it the wallpaper cannot be identified or loaded. The check is a plain File.Exists on Path.Combine(folderPath, \"LivelyInfo.json\").","triggerScenarios":"Calling GetMetadata(folderPath) or CreateFromDirectory(folderPath) with a directory that does not contain LivelyInfo.json. Also reached transitively from any wallpaper-import path that resolves a folder lacking the manifest.","commonSituations":"Pointing the factory at the wrong folder (e.g. the zip's parent instead of its extract target); a partially extracted/copyied wallpaper whose manifest was filtered out; an old or third-party wallpaper folder that never had LivelyInfo.json; path casing/separator issues on the folder argument.","solutions":["Verify the path actually contains LivelyInfo.json: check File.Exists(Path.Combine(folderPath, \"LivelyInfo.json\")) before calling GetMetadata.","Confirm folderPath resolves to the wallpaper's own directory (the sibling of the media file), not a parent or temp extract root.","If importing from an archive, extract it fully first and pass the extracted directory, not the .zip path.","Re-download or re-package the wallpaper so the manifest is present."],"exampleFix":"// before\nvar meta = factory.GetMetadata(folderPath);\n\n// after\nvar manifest = Path.Combine(folderPath, \"LivelyInfo.json\");\nif (!File.Exists(manifest))\n    throw new InvalidOperationException($\"Not a lively wallpaper directory: {folderPath}\");\nvar meta = factory.GetMetadata(folderPath);","handlingStrategy":"validation","validationCode":"string manifest = Path.Combine(folderPath, \"LivelyInfo.json\");\nif (!File.Exists(manifest))\n    throw new DirectoryNotFoundException($\"Not a lively wallpaper directory (missing LivelyInfo.json): {folderPath}\");\nvar meta = factory.GetMetadata(folderPath);","typeGuard":"static bool IsLivelyWallpaperDirectory(string folderPath)\n    => Directory.Exists(folderPath)\n       && File.Exists(Path.Combine(folderPath, \"LivelyInfo.json\"));","tryCatchPattern":"try { var meta = factory.GetMetadata(folderPath); }\ncatch (FileNotFoundException ex) when (ex.Message.Contains(\"LivelyInfo.json\"))\n{\n    // prompt user to pick the wallpaper's own folder / re-import\n}","preventionTips":["Always resolve folderPath to the directory that siblings the media file, not a parent.","Validate the directory contains LivelyInfo.json before calling GetMetadata.","When importing from archives, extract fully and pass the extracted directory."],"tags":["file-io","wallpaper","metadata","validation","manifest"],"backgroundTag":null,"analyzedSha":"c1036feb664960722e34bf4309042c247d6a909d","analyzedAt":"2026-08-13T13:03:12.648Z","schemaVersion":2},"datasetVersion":"2026-08-13T14:17:21.547Z"}