luigi311 / JellyPlex-Watched

Sync watched between jellyfin and plex locally
GNU General Public License v3.0
366 stars 19 forks source link

[Feature Request] - Backup and Restore of watch status. #130

Open devanteweary opened 6 months ago

devanteweary commented 6 months ago

Hey Luigi! What's up man??

I forgot to make this an actual "issue" so here it is.

Basically a feature suggestion to backup and restore each user's watch state.

Maybe the option to select Plex, JF, or both.

Alright see ya!

luigi311 commented 6 months ago

Backup should be easy to handle, i can make it just save the dictionary of the watch list to a file if that file does not exist already that way the backup is only generated on the first run and not replaced after every sync.

Restoring it though might be weird since it will probably need a ENV variable such as RESTORE set to true that will change the path this takes.

Restore can be handled two ways

  1. By generating the current watch status and marking anything that is in the new dictionary and not in the backup as unwatched/partially watched and then exits as if the RUN_ONLY_ONCE variable is set.

  2. Wipe that entire users played list and then running the backup dictionary as if it is going through the normal flow and marking them as watched

1 is a lot less destructive in that it wont have to wipe everything and potentially leave you with nothing watched but that requires more functions being made that might have bugs.
2 has the added benefit just requiring a function that wipes the users watch history as it will use the existing ones for handling the marking for the restore portion.

Either way i wont be implementing this just yet as i want to marinate on which implementation i want to take for the restoring process.

gaming09 commented 6 months ago

that would be awesome