doonze / EmbyUpdate

A python script for automatically updating Emby to the latest version on Linux distros.
GNU Lesser General Public License v3.0
15 stars 3 forks source link

[Feature Request] Self Update #2

Closed zero77 closed 5 years ago

zero77 commented 5 years ago

Can you please get the script to check for new versions of the script and update itself if there's one. Thanks

doonze commented 5 years ago

Hadn't thought about it, but yes, that's possible. I'll have to move config info out of the app into a separate config file. Otherwise, all config items will get overwritten on update. I had thought about doing that for other reasons, so I guess I could include this feature. It will be after the holidays before I dig into this. I'll keep you posted.

zero77 commented 5 years ago

Thanks

doonze commented 5 years ago

Geez man, app grew about 4x larger and 10x more complicated, but it now has the ability to update itself! I do not allow it to update to beta versions, and this one is. But it WILL auto update itself when I release the next Stable version. To be honest the self autoupdate was just a small part of this release. But boy was that a lot of code. Enjoy and please test this out for me! I need feedback!

doonze commented 5 years ago

Crap, I just realized it's going to update itself back to the last Stable version, 1.1. Gotta figure something out real quick.

doonze commented 5 years ago

Ok, well until I figure out a way to keep it from reverting beta's back to Stable releases I re-released the current Beta as a full release. If people really start using this I'll figure out something smart to do about it. But for now, I'll just release all versions as normal releases. Crisis averted.

zero77 commented 5 years ago

@doonze wow the new version looks really good. Although, i am running into some issues, the Emby beta update seems to only update to stable. Also, i initially ran and configured the script as a standard user but, when running the script through a cron as root it asks to configure the script again, even with everything as 0777 permissions. Other than this it looks really good, thanks.

doonze commented 5 years ago

Thanks for the feedback! This is what I need! I'll look into the issues your having.

On Sun, Dec 16, 2018, 7:14 AM zero77 <notifications@github.com wrote:

@doonze https://github.com/doonze wow the new version looks really good. Although, i am running into some issues, the Emby beta update seems to only update to stable. Also, i initially ran and configured the script as a standard user but, when running the script through a cron as root it asks to configure the script again, even with everything as 0777 permissions. Other than this it looks really good, thanks.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/doonze/EmbyUpdate/issues/2#issuecomment-447642482, or mute the thread https://github.com/notifications/unsubscribe-auth/AXwT224LmjsVvxevsDiRNykoI3MEujgxks5u5kc9gaJpZM4ZShCo .

doonze commented 5 years ago

So these are fixed. Release 2.1 is out. It seems during my testing and setting CRON to run every 1 min I pissed off github and my ip is banned at the moment, so I can't do a full test since I posted the release. But it was working when I commited. I don't expect any issues.

Both were easy issues to find and fix. The Beta issue came from me changing the beta variable from a Boolean True/False to a string (Beta/Stable). I had only been testing for Beta = True, any other value caused it to default to Stable. That was what was happening to you. That's fixed and I added logic to let user know if it gets any value other than Beta or Stable.

The CRON issue was a path issue. CRON runs jobs from a it's own path. So the script was looking for the config file on that path. I had code to handle such things, however I had added a large chunk of new code to the script above where I set the path. That included the check for the config file. I simply moved the setting of the path to the top of the script so it runs before anything else. Problem solved.

Run the script once more, it will check Stable one more time, but it should update the script to my newest release. Once the script updates run it once more and it should install Beta like you want.

Todo: Right now it checks for a new script last. As updating the script after the script has started running would be useless, I didn't think it really mattered. But as you see, your going to have to run it twice to get things fixed. Once to get the new release I just made, then a second time to implement the new changes. I'm going to rewrite the logic (soonish, maybe today, maybe not) to do it differently. What I want is it to be able to check for a new version, install one if found, then run the new version. But that is likely not as simple as it sounds... hmmm.....

zero77 commented 5 years ago

Thanks for the reply, everything is working now as you said. Currently cannot think of a good way to update the script then run it, although i will let you know if i do. Thanks