Jump to content

[Plugin / Beta] Status Sync - Batch - one-time / scheduled watched-state backfill between profiles (Server 4.8


Recommended Posts

Posted

Hi all,

I'd like to share a server plugin I've been working on and get some testers before requesting a catalog listing.

**Status Sync - Batch** copies a "source" profile's EXISTING played history to one or more "target" profiles, on demand or on a schedule. The use case it was built for: you set up a shared "family" profile that already has years of watched movies and episodes, and you want to bring everyone else's profiles up to date with it in one pass, without touching anything those users have watched themselves.

Where a real-time sync only reacts to new events going forward, this one fills in the back catalogue that already exists. It is server-side only - there is no client or context-menu UI.

**What it does**

- Runs from **Dashboard -> Scheduled Tasks**, where it registers three tasks, each with a native Run button, progress bar and last-run status:
  - *Status Sync: Run batch* - performs the copy (also runs automatically if you set an interval).
  - *Status Sync: Preview batch* - reports exactly what *would* change and writes nothing; its counts match a real run. See the plugin's read-only "Last run report".
  - *Status Sync: Restore last backup* - rolls targets back to the most recent backup (works even if the plugin is disabled).
- Copies at the leaf level (movies / episodes / audio); the server rolls up season and series counts on its own.
- Conflict / overwrite modes:
  - *Additive* (default) - only adds played, never removes.
  - *Mirror* - makes targets exactly match the source, including unmarking.
  - *Skip existing* - leaves any item the target already has state for untouched.
- Optional toggles: propagate resume position, copy exact play count, propagate favorites / likes, last-played date handling, and an optional date range (only items added within a window).
- Optional library filter and "respect target parental controls" (targets are filtered by enumerating the library as each target user, so the server applies the full policy).
- Optional automatic interval schedule (every N hours); 0 leaves it manual-only.

**Backup & restore**

- With "Back up target state before running" on, a JSON snapshot of every target/item about to change is written to
  `<plugin data folder>/backups/statussync-backup-*.json` before any write. The Restore task re-applies the latest snapshot.

**Guarantees**

- One-directional only: source -> targets.
- Non-transitive: every write it makes is recorded in a private re-entrancy guard, so a write to a profile that is itself a source never chains onward.
- Never touches `library.db` directly - all reads/writes go through `IUserDataManager`.
- Self-targeting is rejected on save.

**Requirements**

- Emby Server 4.8.x.

**Install**

1. Copy `StatusSyncBatch.dll` into your plugins folder:
   - Windows: `%AppData%\Emby-Server\programdata\plugins`
   - Linux: `/var/lib/emby/plugins`
   - Docker: `/config/plugins`
2. Restart Emby Server.
3. Open Dashboard -> Plugins -> Status Sync - Batch -> Settings. It also shows up as
   its own entry in the dashboard's left navigation. Run it from Dashboard ->
   Scheduled Tasks.

**Configure**

Turn it on with the master Enabled switch, pick a Source profile and your Target selection (all other users, or an explicit list), choose which item types to include, pick a conflict mode, and set the state toggles to taste. Optionally set a date range, a backup-before-run, and an automatic interval. Run *Preview batch* first if you want to see the counts in the Last run report before anything is
written.

**Beta note**

DLL is attached to this post. I'd love feedback on stability, on the conflict-mode behaviour, and on backup/restore across different library setups. Please share your server version and anything in the log prefixed with `[StatusSync]` if something looks off.

Thanks!

 

image.thumb.png.6e52ec728d0a423514650df3d9f28e99.png

StatusSyncBatch.dll

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...