ecleese / plexWatchWeb

A web front-end for plexWatch.
255 stars 41 forks source link

Settings Rewrite #143

Closed Arcanemagus closed 9 years ago

Arcanemagus commented 9 years ago

Changes the settings file to be saved in the JSON format. When saving new settings the values are verified to be correct instead of being directly written to the drive. Reading of the settings is cached for up to 60s in a session to speed up access.

Implements https://github.com/ecleese/plexWatchWeb/issues/127.

timrettop commented 9 years ago

@Arcanemagus I was looking at this PR, and merged it into my fork to see it in action, and with my existing config.php, the index page only loads partially with a bunch of 500 errors, and other pages do not load.

You might want to have a converter function, or have the users re-enter settings, depending on what you think is right.

Arcanemagus commented 9 years ago

There is a converter function, which worked on my settings files from the current dev branch. Can you post the errors you are seeing so I can put in checks/fixes for them in there?

Arcanemagus commented 9 years ago

Just an FYI: Currently this breaks somewhat gracefully if the Plex token is de-authorized out from underneath it, but needs a lot of work in that aspect still before I feel comfortable merging this in.

Arcanemagus commented 9 years ago

It appears that the Time and Date formats are getting a new-line pushed in there somehow, as soon as that gets fixed I think this is ready for merging.

@timrettop Can you please try out the current state and see if you are having errors importing your settings? That is probably the aspect that will potentially have the most issues so any input is greatly appreciated.

timrettop commented 9 years ago

@arcanemagus I should be able to give this a whirl tonight, I'll let you know!

Arcanemagus commented 9 years ago

@timrettop Looks like since I last tested it and now it broke reading the original settings, getting that working properly again right now :wink:.

Arcanemagus commented 9 years ago

@timrettop That should work for you! When you first load this with an older style settings file it will process it into the new format (verifying values as it does so), and then overwrite the settings file to the new style.

At this point I can't get it to break (into an unrecoverable state) so I'll be merging this in in the morning unless I hear that there are further issues with it first.