Monitor Files on Windows and notify Emby through API.
Emby DOES have a built-in file watcher to monitor folders for changes. However, the docker version of Emby relies on inotify, which is not supported on Windows hosts. This means that if you are running Emby in a Docker container on a Windows machine, the built-in file watcher will not work. This project aims to fill that gap by providing a way to monitor files on Windows and notify Emby of any changes.
- Download the latest release from the Releases. Or, build it yourself with source code.
- The
framework-dependentversion need.net 10 runtime. You can download it here.Desktopsupport is NOT necessary for this application. - The
self-contained-singlefileversion can be run without runtime installed.
- The
- Edit appsettings.json to configure:
- your Emby server URL
embyBaseUrland API keyembyApiKeyunderembyClientsection.EmbyEnvironmentPathCaseSensitivemust be set to true for Linux based docker containers like Emby official docker container. - the paths you want to monitor from the Windows which runs this application as key, and the paths mounted as target in Emby docker container as values under
pathMappingsofpathMatchersection. Multiple paths can be monitored by adding moreSource-Targetspairs. Each source must be unique. Each source can have multiple target paths.sourcePathCaseSensitivemust be set to false for local paths on Windows hosts. - (optional) other settings:
cachedEmbyLibrariessection:cacheDurationInSecondscontrols how long to cache Emby library info to reduce API calls. Default is 3600 seconds (1 hour). Set to0to let cache never expire. Set to negative value to disable caching.cachedEmbyItemsCachesection: controls how many Emby items to cache in memory to reduce API calls. See MemoryCacheOptions for details.cachedEmbyItemsEntrysection:slidingExpirationInSecondscontrols how long each cached Emby item will stay in cache since last accessed. Default is00:05:00.slidingExpirationcontrols whether to use sliding expiration or absolute expiration. Default is00:01:00. See MemoryCacheEntryOptions for details.folderWatchersections:retryDelaycontrols how long to wait before restarting FileSystemWatcher after an error occurs. Default is00:00:02.ignoredExtensionscontrols which file extensions to ignore when monitoring file changes.cachedPatchMatcherCachesection: controls how many path mappings to cache in memory to reduce path matching time. See MemoryCacheOptions for details.cachedPatchMatcherEntrysection:slidingExpirationInSecondscontrols how long each cached path mapping will stay in cache since last accessed. Default is00:05:00.slidingExpirationcontrols whether to use sliding expiration or absolute expiration. Default is00:01:00. See MemoryCacheEntryOptions for details.refreshDelaysection:refreshDelaycontrols how long to wait before sending refresh command to Emby after a file change is detected. Default is00:00:05. This is to avoid sending too many refresh commands in a short period of time when multiple file changes occur.resetDelayOnRequestcontrols whether to reset the delay timer when a new file change is detected for the same path. Default isfalse.
- your Emby server URL
- Run the application in the same Windows host in
console. The application will monitor the specified paths for file changes and notify Emby through API when changes are detected. You can enable debug logging by providedebugas argument. - After testing, you can set up the application as a Windows Service by providing argument to this application with administrative privilege:
install: to install the application as a Windows Service. Service name isFile Watcher for Emby. It will start automatically with Windows.uninstall: to uninstall the Windows Service.start: to start the Windows Service.stop: to stop the Windows Service.
- You need a Windows to run this application. This application is designed for Windows only.
- Local and Windows shared folders (UNC as path) are both supported.
- For Windows Service mode, make sure the service account has access to the folders being monitored.